Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions doc-snippets/extensions-minimal/oats/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ services:
environment:
OTEL_SERVICE_NAME: "extensions-minimal-test-app"
OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4318
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: http://lgtm:4318/v1/traces
OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
ports:
- "8080:8080"
- "8080:8080"
1 change: 0 additions & 1 deletion doc-snippets/spring-starter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter")
implementation("io.opentelemetry.contrib:opentelemetry-samplers:1.51.0-alpha")
}

springBoot {
Expand Down
17 changes: 0 additions & 17 deletions javaagent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,3 @@ curl http://localhost:8080/ping
```

Watch for spans, metrics, and logs in the Collector log output.

## Declarative Configuration

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.

`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:

- Configuration of instrumentation (see `.instrumentation.java`)
- Configuration of [rule-based routing sampler](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/samplers) (see `.tracer_provider.sampler.parent_based.root`)

To use declarative configuration instead of the environment variable scheme, add the following before starting the application and Collector:

```shell
export OTEL_EXPERIMENTAL_CONFIG_FILE=/sdk-config.yaml
```

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.
11 changes: 1 addition & 10 deletions javaagent/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@ services:
build: ./
environment:
OTEL_SERVICE_NAME: "agent-example-app"
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://collector:4318/v1/traces"
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "http://collector:4318/v1/metrics"
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: "http://collector:4318/v1/logs"
# Logs are disabled by default
OTEL_LOGS_EXPORTER: "otlp"
# Optional specify file configuration instead of using environment variable scheme
# To use, call "export OTEL_EXPERIMENTAL_CONFIG_FILE=/sdk-config.yaml" before calling docker compose up
OTEL_EXPERIMENTAL_CONFIG_FILE:
OTEL_EXPORTER_OTLP_ENDPOINT: "http://collector:4318"
ports:
- "8080:8080"
volumes:
- ./sdk-config.yaml:/sdk-config.yaml
depends_on:
- collector
collector:
Expand Down
248 changes: 0 additions & 248 deletions javaagent/sdk-config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions spring-native/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,4 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
implementation("com.h2database:h2")
implementation("io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter")

// for otelCustomizer in Application.java
implementation("io.opentelemetry.contrib:opentelemetry-samplers:1.51.0-alpha")
}
Loading