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
2 changes: 1 addition & 1 deletion javaagent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ FROM eclipse-temurin:11-jre
ADD build/libs/app.jar /app.jar
ADD build/agent/opentelemetry-javaagent.jar /opentelemetry-javaagent.jar

ENTRYPOINT java -jar -javaagent:/opentelemetry-javaagent.jar /app.jar
ENTRYPOINT java -javaagent:/opentelemetry-javaagent.jar -jar /app.jar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the -jar -javaagent ordering was causing a manifest error trying to load the jar

2 changes: 1 addition & 1 deletion javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {
//spring modules
implementation("org.springframework.boot:spring-boot-starter-web")

agent("io.opentelemetry.javaagent:opentelemetry-javaagent:2.8.0")
agent("io.opentelemetry.javaagent:opentelemetry-javaagent:2.9.0")
}

val copyAgent = tasks.register<Copy>("copyAgent") {
Expand Down
4 changes: 2 additions & 2 deletions javaagent/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ services:
# Logs are disabled by default
OTEL_LOGS_EXPORTER: "otlp"
# Optional specify file configuration instead of using environment variable scheme
# To use, call "export OTEL_CONFIG_FILE=/sdk-config.yaml" before calling docker compose up
OTEL_CONFIG_FILE:
OTEL_EXPERIMENTAL_CONFIG_FILE: /sdk-config.yaml
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i figured this behavior could be the default in the example, but I can return it to being optional if we want

ports:
- "8080:8080"
volumes:
- ./sdk-config.yaml:/sdk-config.yaml
depends_on:
- collector

collector:
image: otel/opentelemetry-collector-contrib:0.111.0
volumes:
Expand Down
9 changes: 5 additions & 4 deletions javaagent/sdk-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@ file_format: "0.1"

resource:
attributes:
service.name: agent-example-app
- name: service.name
value: agent-example-app

logger_provider:
processors:
- batch:
exporter:
otlp:
endpoint: http://collector:4318
endpoint: http://collector:4318/v1/logs
protocol: http/protobuf

tracer_provider:
processors:
- batch:
exporter:
otlp:
endpoint: http://collector:4318
endpoint: http://collector:4318/v1/traces
protocol: http/protobuf

meter_provider:
readers:
- periodic:
exporter:
otlp:
endpoint: http://collector:4318
endpoint: http://collector:4318/v1/metrics
protocol: http/protobuf
# Example of how to use view to drop a metric which isn't needed.
# This configuration is not available with the environment variable configuration scheme.
Expand Down
Loading