Skip to content

Commit 989d895

Browse files
authored
Cleanup javaagent example (#914)
1 parent d8b3a7b commit 989d895

File tree

5 files changed

+3
-279
lines changed

5 files changed

+3
-279
lines changed

declarative-configuration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ export OTEL_EXPERIMENTAL_CONFIG_FILE=$(pwd)/otel-sdk-config.yaml
2020

2121
Observe how data is printed to the console as configured in [otel-sdk-config.yaml](./otel-sdk-config.yaml).
2222

23-
For use with the OpenTelemetry Java Agent, see [Java Agent declarative configuration](../javaagent/README.md#declarative-configuration).
23+
For use with the OpenTelemetry Java Agent, see [Java Agent declarative configuration](../javaagent-declarative-configuration).

doc-snippets/extensions-minimal/oats/docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ services:
77
environment:
88
OTEL_SERVICE_NAME: "extensions-minimal-test-app"
99
OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4318
10-
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://lgtm:4318/v1/traces
11-
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
1210
ports:
13-
- "8080:8080"
11+
- "8080:8080"

javaagent/README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,3 @@ curl http://localhost:8080/ping
4444
```
4545

4646
Watch for spans, metrics, and logs in the Collector log output.
47-
48-
## Declarative Configuration
49-
50-
By default, this example uses the [environment variable configuration schema](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md) to configure the SDK. However, it also includes [sdk-config.yaml](./sdk-config.yaml) which demonstrates how the [declarative configuration](https://opentelemetry.io/docs/specs/otel/configuration/#declarative-configuration) scheme can be used to configure the SDK based on a YAML configuration file instead.
51-
52-
`sdk-config.yaml` extends the [opentelemetry-configuration sdk-config.yaml](https://github.com/open-telemetry/opentelemetry-configuration/blob/v0.3.0/examples/sdk-config.yaml) template, demonstrating:
53-
54-
- Configuration of instrumentation (see `.instrumentation.java`)
55-
- Configuration of [rule-based routing sampler](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/samplers) (see `.tracer_provider.sampler.parent_based.root`)
56-
57-
To use declarative configuration instead of the environment variable scheme, add the following before starting the application and Collector:
58-
59-
```shell
60-
export OTEL_EXPERIMENTAL_CONFIG_FILE=/sdk-config.yaml
61-
```
62-
63-
Note: toggling declarative configuration causes the env var configuration scheme to be ignored completely. However, there is support for [env var substitution](https://opentelemetry.io/docs/specs/otel/configuration/data-model/#environment-variable-substitution) within configuration files.

javaagent/docker-compose.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,9 @@ services:
44
build: ./
55
environment:
66
OTEL_SERVICE_NAME: "agent-example-app"
7-
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://collector:4318/v1/traces"
8-
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "http://collector:4318/v1/metrics"
9-
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: "http://collector:4318/v1/logs"
10-
# Logs are disabled by default
11-
OTEL_LOGS_EXPORTER: "otlp"
12-
# Optional specify file configuration instead of using environment variable scheme
13-
# To use, call "export OTEL_EXPERIMENTAL_CONFIG_FILE=/sdk-config.yaml" before calling docker compose up
14-
OTEL_EXPERIMENTAL_CONFIG_FILE:
7+
OTEL_EXPORTER_OTLP_ENDPOINT: "http://collector:4318"
158
ports:
169
- "8080:8080"
17-
volumes:
18-
- ./sdk-config.yaml:/sdk-config.yaml
1910
depends_on:
2011
- collector
2112
collector:

javaagent/sdk-config.yaml

Lines changed: 0 additions & 248 deletions
This file was deleted.

0 commit comments

Comments
 (0)