File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Collection of 3rd-party packages for [OpenTelemetry-Go](https://github.com/open-
13
13
- [ Instrumentation] ( ./instrumentation/ ) : Packages providing OpenTelemetry instrumentation for 3rd-party libraries.
14
14
- [ Propagators] ( ./propagators/ ) : Packages providing OpenTelemetry context propagators for 3rd-party propagation formats.
15
15
- [ Detectors] ( ./detectors/ ) : Packages providing OpenTelemetry resource detectors for 3rd-party cloud computing environments.
16
+ - [ Samplers] ( ./samplers/ ) : Packages providing additional implementations of OpenTelemetry samplers.
16
17
17
18
## Project Status
18
19
@@ -23,7 +24,7 @@ board](https://github.com/orgs/open-telemetry/projects/5).
23
24
### Compatibility
24
25
25
26
26
- OpenTelemetry-Go Contrib ensures compatibility with the current supported
27
+ OpenTelemetry-Go Contrib ensures compatibility with the current supported
27
28
versions of
28
29
the [ Go language] ( https://golang.org/doc/devel/release#policy ) :
29
30
Original file line number Diff line number Diff line change 2
2
3
3
This package implements [ Jaeger remote sampler] ( https://www.jaegertracing.io/docs/latest/sampling/#collector-sampling-configuration ) .
4
4
5
+ ## Usage
6
+
7
+ Configuration in the code:
8
+
9
+ ``` go
10
+ jaegerRemoteSampler := jaegerremote.New (
11
+ " your-service-name" ,
12
+ jaegerremote.WithSamplingServerURL (" http://{sampling_service_host_name}:5778" ),
13
+ jaegerremote.WithSamplingRefreshInterval (10 *time.Second ),
14
+ jaegerremote.WithInitialSampler (trace.TraceIDRatioBased (0.5 )),
15
+ )
16
+
17
+ tp := trace.NewTracerProvider (
18
+ trace.WithSampler (jaegerRemoteSampler),
19
+ ...
20
+ )
21
+ otel.SetTracerProvider (tp)
22
+ ```
23
+
24
+ Notes:
25
+
26
+ * At this time, the Jaeger Remote Sampler can only be configured in the code,
27
+ configuration via ` OTEL_TRACES_SAMPLER=jaeger_sampler ` environment variable is not supported.
28
+ * Service name must be passed to the constructor. It will be used by the sampler to poll
29
+ the backend for the sampling strategy for this service.
30
+ * Both Jaeger Agent and OpenTelemetry Collector implement the Jaeger sampling service endpoint.
31
+
5
32
## Example
6
33
7
34
[ example/] ( ./example ) shows how to host remote sampling strategies using the OpenTelemetry Collector.
You can’t perform that action at this time.
0 commit comments