File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
microbootstrap/instruments Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -429,6 +429,7 @@ Parameters description:
429429- ` opentelemetry_instrumentors ` - a list of extra instrumentors.
430430- ` opentelemetry_exclude_urls ` - list of ignored urls.
431431- ` opentelemetry_log_traces ` - traces will be logged to stdout.
432+ - ` opentelemetry_generate_health_check_spans ` - generate spans for health check handlers if ` True `
432433
433434These settings are subsequently passed to [ opentelemetry] ( https://opentelemetry.io/ ) , finalizing your Opentelemetry integration.
434435
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ class OpentelemetryConfig(BaseInstrumentConfig):
6666 ],
6767 )
6868 opentelemetry_log_traces : bool = False
69+ opentelemetry_generate_health_check_spans : bool = True
6970
7071
7172@typing .runtime_checkable
@@ -169,7 +170,11 @@ def bootstrap(self) -> None:
169170class OpentelemetryInstrument (BaseOpentelemetryInstrument [OpentelemetryConfig ]):
170171 def define_exclude_urls (self ) -> list [str ]:
171172 exclude_urls = [* self .instrument_config .opentelemetry_exclude_urls ]
172- if self .instrument_config .health_checks_path and self .instrument_config .health_checks_path not in exclude_urls :
173+ if (
174+ not self .instrument_config .opentelemetry_generate_health_check_spans
175+ and self .instrument_config .health_checks_path
176+ and self .instrument_config .health_checks_path not in exclude_urls
177+ ):
173178 exclude_urls .append (self .instrument_config .health_checks_path )
174179 return exclude_urls
175180
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ def minimal_opentelemetry_config() -> OpentelemetryConfig:
102102 opentelemetry_endpoint = "/my-engdpoint" ,
103103 opentelemetry_namespace = "namespace" ,
104104 opentelemetry_container_name = "container-name" ,
105+ opentelemetry_generate_health_check_spans = False ,
105106 )
106107
107108
You can’t perform that action at this time.
0 commit comments