Skip to content

Commit 227bde8

Browse files
authored
Update README config settings (#830)
* Update README config settings * Fix Jaeger env var names * Rename ota prefix to otel * Add multi-propagator doc * Include multi-propagator explanation
1 parent 138128e commit 227bde8

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

README.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ Configuration parameters are passed as Java system properties (`-D` flags) or
3939
as environment variables (see below for full list). For example:
4040
```
4141
java -javaagent:path/to/opentelemetry-javaagent-all.jar \
42-
-Dota.exporter=zipkin
42+
-Dotel.exporter=zipkin
4343
-jar myapp.jar
4444
```
4545

46-
External exporter jar can be specified via `ota.exporter.jar` system property:
46+
External exporter jar can be specified via `otel.exporter.jar` system property:
4747
```
4848
java -javaagent:path/to/opentelemetry-javaagent-all.jar \
49-
-Dota.exporter.jar=path/to/external-exporter.jar
49+
-Dotel.exporter.jar=path/to/external-exporter.jar
5050
-jar myapp.jar
5151
```
5252

@@ -61,29 +61,29 @@ behavior you may find.
6161
A simple wrapper for the Jaeger exporter of opentelemetry-java. It currently
6262
only supports gRPC as its communications protocol.
6363

64-
| System property | Environment variable | Purpose |
65-
|----------------------------------|----------------------------------|----------------------------------------------------------------------|
66-
| ota.exporter=jaeger | OTA_EXPORTER=jaeger | To select Jaeger exporter |
67-
| JAEGER_ENDPOINT | JAEGER_ENDPOINT | The Jaeger endpoint to connect to. Currently only gRPC is supported. |
68-
| JAEGER_SERVICE_NAME | JAEGER_SERVICE_NAME | The service name of this JVM instance |
64+
| System property | Environment variable | Purpose |
65+
|--------------------------|--------------------------|----------------------------------------------------------------------------------------------------|
66+
| otel.exporter=jaeger | OTEL_EXPORTER=jaeger | To select Jaeger exporter |
67+
| otel.jaeger.endpoint | OTEL_JAEGER_ENDPOINT | The Jaeger endpoint to connect to, default is "localhost:14250", currently only gRPC is supported. |
68+
| otel.jaeger.service.name | OTEL_JAEGER_SERVICE_NAME | The service name of this JVM instance, default is "unknown". |
6969

7070
#### Zipkin exporter
7171
A simple wrapper for the Zipkin exporter of opentelemetry-java. It POSTs json in [Zipkin format](https://zipkin.io/zipkin-api/#/default/post_spans) to a specified HTTP URL.
7272

73-
| System property | Environment variable | Purpose |
74-
|----------------------------------|----------------------------------|----------------------------------------------------------------------|
75-
| ota.exporter=zipkin | OTA_EXPORTER=zipkin | To select Zipkin exporter |
76-
| otel.zipkin.endpoint | OTEL_ZIPKIN_ENDPOINT | The Zipkin endpoint to connect to. Currently only HTTP is supported. |
77-
| otel.zipkin.service.name | OTEL_ZIPKIN_SERVICE_NAME | The service name of this JVM instance |
73+
| System property | Environment variable | Purpose |
74+
|--------------------------|--------------------------|-----------------------------------------------------------------------------------------------------------------------|
75+
| otel.exporter=zipkin | OTEL_EXPORTER=zipkin | To select Zipkin exporter |
76+
| otel.zipkin.endpoint | OTEL_ZIPKIN_ENDPOINT | The Zipkin endpoint to connect to, default is "http://localhost:9411/api/v2/spans". Currently only HTTP is supported. |
77+
| otel.zipkin.service.name | OTEL_ZIPKIN_SERVICE_NAME | The service name of this JVM instance, default is "unknown". |
7878

7979
#### OTLP exporter
8080

8181
A simple wrapper for the OTLP exporter of opentelemetry-java.
8282

8383
| System property | Environment variable | Purpose |
8484
|----------------------------------|----------------------------------|-------------------------------------------------------------------------|
85-
| ota.exporter=otlp (default) | OTA_EXPORTER=otlp | To select OpenTelemetry exporter (default) |
86-
| otel.otlp.endpoint | OTEL_OTLP_ENDPOINT | The OTLP endpoint to connect to. |
85+
| otel.exporter=otlp (default) | OTEL_EXPORTER=otlp | To select OpenTelemetry exporter (default) |
86+
| otel.otlp.endpoint | OTEL_OTLP_ENDPOINT | The OTLP endpoint to connect to, default is "localhost:55680" |
8787
| otel.otlp.use.tls | OTEL_OTLP_USE_TLS | To use or not TLS, default is false. |
8888
| otel.otlp.metadata | OTEL_OTLP_METADATA | The key-value pairs separated by semicolon to pass as request metadata. |
8989
| otel.otlp.span.timeout | OTEL_OTLP_SPAN_TIMEOUT | The max waiting time allowed to send each span batch, default is 1000. |
@@ -96,27 +96,31 @@ to the OpenTelemetry Resource ([see below](#opentelemetry-resource)), e.g. `OTEL
9696
The logging exporter simply prints the name of the span along with its
9797
attributes to stdout. It is used mainly for testing and debugging.
9898

99-
| System property | Environment variable | Purpose |
100-
|-----------------------------|-----------------------------|------------------------------------------------------------------------------|
101-
| ota.exporter=logging | OTA_EXPORTER=logging | To select logging exporter |
102-
| ota.exporter.logging.prefix | OTA_EXPORTER_LOGGING_PREFIX | An optional string that is printed in front of the span name and attributes. |
99+
| System property | Environment variable | Purpose |
100+
|------------------------------|------------------------------|------------------------------------------------------------------------------|
101+
| otel.exporter=logging | OTEL_EXPORTER=logging | To select logging exporter |
102+
| otel.exporter.logging.prefix | OTEL_EXPORTER_LOGGING_PREFIX | An optional string that is printed in front of the span name and attributes. |
103103

104104
#### Propagator
105105

106106
The propagator controls which distributed tracing header format is used.
107107

108-
| System property | Environment variable | Purpose |
109-
|-----------------|----------------------|-----------------------------------------------------------------------------------------|
110-
| ota.propagators | OTA_PROPAGATORS | Default is "tracecontext" (W3C). Other supported values are "b3", "b3single", "jaeger". |
108+
If this is set to a comma-delimited list of the values, the multi-propagator will be used.
109+
The multi-propagator will try to extract the context from incoming requests using each of the configured propagator formats (in order), stopping after the first successful context extraction.
110+
The multi-propagator will inject the context into outgoing requests using all the configured propagator formats.
111+
112+
| System property | Environment variable | Purpose |
113+
|------------------|----------------------|-------------------------------------------------------------------------------------------------------------|
114+
| otel.propagators | OTEL_PROPAGATORS | Default is "tracecontext" (W3C). Other supported values are "b3", "b3single", "jaeger", "ottracer", "xray". |
111115

112116
#### OpenTelemetry Resource
113117

114118
The [OpenTelemetry Resource](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/sdk.md)
115119
is a representation of the entity producing telemetry.
116120

117-
| System property | Environment variable | Purpose |
118-
|-----------------|--------------------------|------------------------------------------------------------------------------|
119-
| (not yet) | OTEL_RESOURCE_ATTRIBUTES | Used to specify resource attributes in format: key1=val1,key2=val2,key3=val3 |
121+
| System property | Environment variable | Purpose |
122+
|--------------------------|--------------------------|------------------------------------------------------------------------------|
123+
| otel.resource.attributes | OTEL_RESOURCE_ATTRIBUTES | Used to specify resource attributes in format: key1=val1,key2=val2,key3=val3 |
120124

121125
#### Batch span processor
122126

@@ -154,7 +158,7 @@ The OpenTelemetry API exposes SPI [hooks](https://github.com/open-telemetry/open
154158
for customizing its behavior, such as the `Resource` attached to spans or the `Sampler`.
155159

156160
Because the auto instrumentation runs in a separate classpath than the instrumented application, it is not possible for customization in the application to take advantage of this customization. In order to provide such customization, you can
157-
provide the path to a JAR file including an SPI implementation using the system property `ota.initializer.jar`. Note that this JAR will need to shade the OpenTelemetry API in the same way as the agent does. The simplest way to do this is to use the same shading configuration as the agent from [here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/cfade733b899a2f02cfec7033c6a1efd7c54fd8b/java-agent/java-agent.gradle#L39). In addition, you will have to specify the `io.opentelemetry.auto.shaded.io.opentelemetry.trace.spi.TraceProvider` to the name of the class that implements the SPI.
161+
provide the path to a JAR file including an SPI implementation using the system property `otel.initializer.jar`. Note that this JAR will need to shade the OpenTelemetry API in the same way as the agent does. The simplest way to do this is to use the same shading configuration as the agent from [here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/cfade733b899a2f02cfec7033c6a1efd7c54fd8b/java-agent/java-agent.gradle#L39). In addition, you will have to specify the `io.opentelemetry.auto.shaded.io.opentelemetry.trace.spi.TraceProvider` to the name of the class that implements the SPI.
158162

159163
## Supported Java libraries and frameworks
160164

@@ -220,8 +224,8 @@ For this reason the following instrumentations are disabled by default:
220224
- `servlet-filter` which creates spans around Servlet Filter methods.
221225
- `servlet-service` which creates spans around Servlet methods.
222226

223-
To enable them, add `ota.integration.<name>.enabled` system property:
224-
`-Dota.integration.jdbc-datasource.enabled=true`
227+
To enable them, add `otel.integration.<name>.enabled` system property:
228+
`-Dotel.integration.jdbc-datasource.enabled=true`
225229

226230
#### Grizzly instrumentation
227231

@@ -231,7 +235,7 @@ Servlet-based applications, you get better experience from Servlet-specific
231235
support. As these two instrumentations conflict with each other, more generic
232236
instrumentation for Grizzly http server is disabled by default. If needed,
233237
you can enable it by add the following system property:
234-
`-Dota.integration.grizzly.enabled=true`
238+
`-Dotel.integration.grizzly.enabled=true`
235239

236240
### Suppressing specific auto-instrumentation
237241

auto-exporters/otlp/src/main/java/io/opentelemetry/auto/exporters/otlp/OtlpMetricExporterFactory.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,18 @@
1616

1717
package io.opentelemetry.auto.exporters.otlp;
1818

19-
import io.grpc.ManagedChannelBuilder;
2019
import io.opentelemetry.exporters.otlp.OtlpGrpcMetricExporter;
2120
import io.opentelemetry.sdk.extensions.auto.config.Config;
2221
import io.opentelemetry.sdk.extensions.auto.config.MetricExporterFactory;
2322
import io.opentelemetry.sdk.metrics.export.MetricExporter;
2423

2524
public class OtlpMetricExporterFactory implements MetricExporterFactory {
26-
private static final String OTLP_ENDPOINT = "otlp.endpoint";
2725

2826
@Override
2927
public MetricExporter fromConfig(final Config config) {
30-
String otlpEndpoint = config.getString(OTLP_ENDPOINT, "localhost:55680");
31-
if (otlpEndpoint.isEmpty()) {
32-
throw new IllegalStateException("otel.exporter.otlp.endpoint is required");
33-
}
3428
return OtlpGrpcMetricExporter.newBuilder()
35-
.setChannel(ManagedChannelBuilder.forTarget(otlpEndpoint).usePlaintext().build())
29+
.readEnvironmentVariables()
30+
.readSystemProperties()
3631
.build();
3732
}
3833
}

0 commit comments

Comments
 (0)