You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add support for OTEL_TRACES_SAMPLER
* Added CHANGELOG
* Added tests and modified README
* Remove extra space
* Fix formatting
* Added tests and modified README
* Fix README
* Fix black
* Add sample for different sampling configurations
* Fix cspell
Copy file name to clipboardExpand all lines: sdk/monitor/azure-monitor-opentelemetry/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,8 +82,8 @@ You can configure further with [OpenTelemetry environment variables][ot_env_vars
82
82
|`OTEL_TRACES_EXPORTER`| If set to `None`, disables collection and export of distributed tracing telemetry. |
83
83
|`OTEL_BLRP_SCHEDULE_DELAY`| Specifies the logging export interval in milliseconds. Defaults to 5000. |
84
84
|`OTEL_BSP_SCHEDULE_DELAY`| Specifies the distributed tracing export interval in milliseconds. Defaults to 5000. |
85
-
|`OTEL_TRACES_SAMPLER`| Specifies the sampler to be used for traces. Supports both[application_insights_sampling] and [rate_limited_sampling]. Use `microsoft.fixed.percentage` for the Application Insights sampler or `microsoft.rate_limited` for the Rate Limited sampler. |
86
-
|`OTEL_TRACES_SAMPLER_ARG`| Specifies the sampling parameter for the configured sampler. For the Application Insights sampler, this sets the ratio of distributed tracing telemetry to be [sampled][application_insights_sampling] with accepted values in the range [0,1]. Defaults to 1.0 (no sampling). For the Rate Limited sampler, this sets the maximum traces per second to be [sampled][rate_limited_sampler]. For example, 0.5 means one trace every two seconds, while 5.0 means five traces per second. |
85
+
|`OTEL_TRACES_SAMPLER`| Specifies the sampler to be used for traces. Supports `always_on`, `always_off`, `trace_id_ratio`, `parentbased_always_on`, `parentbased_always_off`, `parentbased_trace_id_ratio`,[application_insights_sampling] and [rate_limited_sampling]. Use `microsoft.fixed.percentage` for the Application Insights sampler or `microsoft.rate_limited` for the Rate Limited sampler. |
86
+
|`OTEL_TRACES_SAMPLER_ARG`| Specifies the sampling parameter for the configured sampler. For the standard OpenTelemetry samplers `trace_id_ratio` and `parentbased_trace_id_ratio`, this is the sampling ratio in the range [0.0, 1.0]. Not needed to be specified for `always_on`, `always_off`, `parentbased_always_on`, or `parentbased_always_off` samplers. For the Application Insights sampler, this sets the ratio of distributed tracing telemetry to be [sampled][application_insights_sampling] with accepted values in the range [0,1]. Defaults to 1.0 (no sampling). For the Rate Limited sampler, this sets the maximum traces per second to be [sampled][rate_limited_sampler]. For example, 0.5 means one trace every two seconds, while 5.0 means five traces per second. |
87
87
|`OTEL_PYTHON_DISABLED_INSTRUMENTATIONS`| Specifies which of the supported instrumentations to disable. Disabled instrumentations will not be instrumented as part of `configure_azure_monitor`. However, they can still be manually instrumented with `instrument()` directly. Accepts a comma-separated list of lowercase [Library Names](#officially-supported-instrumentations). For example, set to `"psycopg2,fastapi"` to disable the Psycopg2 and FastAPI instrumentations. Defaults to an empty list, enabling all supported instrumentations. |
88
88
|`OTEL_EXPERIMENTAL_RESOURCE_DETECTORS`| An experimental OpenTelemetry environment variable used to specify Resource Detectors to be used to generate Resource Attributes. This is an experimental feature and the name of this variable and its behavior can change in a non-backwards compatible way. Defaults to "azure_app_service,azure_vm" to enable the [Azure Resource Detectors][ot_resource_detector_azure] for Azure App Service and Azure VM. To add or remove specific resource detectors, set the environment variable accordingly. See the [OpenTelemetry Python Resource Detector Documentation][ot_python_resource_detectors] for more. |
# Set the OTEL_TRACES_SAMPLER environment variable to "always_on"
6
+
# The sampling rate is 1.0, so 100% of the traces are sampled.
7
+
8
+
# Using always_off sampler
9
+
# Set the OTEL_TRACES_SAMPLER environment variable to "always_off"
10
+
# The sampling rate is 0.0, so None of the traces are sampled.
11
+
12
+
# Using trace_id_ratio sampler
13
+
# Set the OTEL_TRACES_SAMPLER environment variable to "trace_id_ratio"
14
+
# Set the OTEL_TRACES_SAMPLER_ARG environment variable to 0.1, it has to be a number between 0 and 1, else it will throw an error and default to 1.0
15
+
# The sampling rate is 0.1 means approximately 10% of your traces are sent
16
+
17
+
# Using parentbased_always_on sampler
18
+
# Set the OTEL_TRACES_SAMPLER environment variable to "parentbased_always_on"
19
+
# The sampling rate is 1.0, so 100% of the traces are sampled.
20
+
21
+
# Using parentbased_always_off sampler
22
+
# Set the OTEL_TRACES_SAMPLER environment variable to "parentbased_always_off"
23
+
# The sampling rate is 0.0, so None of the traces are sampled.
24
+
25
+
# Using parentbased_trace_id_ratio sampler
26
+
# Set the OTEL_TRACES_SAMPLER environment variable to "parentbased_trace_id_ratio"
27
+
# Set the OTEL_TRACES_SAMPLER_ARG environment variable to 0.45, it has to be a number between 0 and 1, else it will throw an error and default to 1.0
28
+
# The sampling rate is 0.45 means approximately 45% of your traces are sent
29
+
30
+
# Using rate limited sampler
31
+
# Set the OTEL_TRACES_SAMPLER environment variable to "microsoft.rate_limited"
32
+
# Set the OTEL_TRACES_SAMPLER_ARG environment variable to the desired rate limit (e.g., 0.5 means one trace every two seconds, while 5.0 means five traces per second)
33
+
34
+
# Using fixed percentage sampler
35
+
# Set the OTEL_TRACES_SAMPLER environment variable to "microsoft.fixed.percentage"
36
+
# Set the OTEL_TRACES_SAMPLER_ARG environment variable to 0.2, it has to be a number between 0 and 1, else it will throw an error and default to 1.0
37
+
38
+
# Using trace_based_sampling configuration # cspell: ignore unsampled
39
+
# Determines whether the logger should drop log records associated with unsampled traces.
40
+
# Passing the enable_trace_based_sampling_for_logs=True argument to configure_azure_monitor ensure that log records associated with unsampled traces are dropped by the `Logger`.
41
+
# A log record is considered associated with an unsampled trace if it has a valid `SpanId` and its `TraceFlags` indicate that the trace is unsampled.
0 commit comments