Skip to content

Commit 53e0989

Browse files
committed
add example for OTLP logging via stdout and k8s
1 parent e9a828d commit 53e0989

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

.github/renovate.json5

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,18 @@
3434
"matchPackageNames": ["eclipse-temurin"],
3535
"enabled": false
3636
}
37+
],
38+
"customManagers": [
39+
{
40+
"customType": "regex",
41+
"description": "Update _VERSION variables in Dockerfiles",
42+
"fileMatch": [
43+
"(^|/|\\.)Dockerfile$",
44+
"(^|/)Dockerfile\\.[^/]*$"
45+
],
46+
"matchStrings": [
47+
"# renovate: datasource=(?<datasource>[a-z-]+?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s(?:ENV|ARG) .+?_VERSION=(?<currentValue>.+?)\\s"
48+
]
49+
}
3750
]
3851
}

.github/workflows/acceptance-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ jobs:
3030
uses: actions/upload-artifact@v4
3131
if: failure()
3232
with:
33-
name: docker-compose.log
34-
path: oats/yaml/build/**/output.log
33+
name: log output
34+
path: oats/yaml/build/**/*.log

logging-otlp/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ FROM eclipse-temurin:21-jre
22

33
WORKDIR /usr/src/app/
44

5-
COPY build/libs/*SNAPSHOT.jar ./app.jar
6-
# we ignore the version (which is from upstream) and use the latest version of the grafana distribution
7-
# todo: with renovate update
8-
ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.10.0/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar
9-
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar
5+
# renovate: datasource=github-releases depName=opentelemetry-java-instrumentation packageName=open-telemetry/opentelemetry-java-instrumentation
6+
ENV OPENTELEMETRY_JAVA_INSTRUMENTATION_VERSION=v2.10.0
7+
8+
ADD build/libs/*SNAPSHOT.jar ./app.jar
9+
ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/$OPENTELEMETRY_JAVA_INSTRUMENTATION_VERSION/opentelemetry-javaagent.jar ./opentelemetry-javaagent.jar
10+
ENV JAVA_TOOL_OPTIONS=-javaagent:./opentelemetry-javaagent.jar
1011

1112
EXPOSE 8080
1213
ENTRYPOINT [ "java", "-jar", "./app.jar" ]

logging-otlp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
1. Build the Docker image using using `build.sh`
66
2. Deploy the manifest using `kubectl apply -f k8s/` (e.g. using [k3d.sh](k3d.sh))
7-
3. Generate traffic using [generate-traffic.sh](../../../generate-traffic.sh)
7+
3. Generate traffic using [generate-traffic.sh](./generate-traffic.sh)
88
4. Log in to [http://localhost:3000](http://localhost:3000) with user _admin_ and password _admin_.
99
5. Go to "Explore"
1010
6. Select "Loki" as data source

logging-otlp/generate-traffic.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
watch 'curl -s http://localhost:8080/rolldice'

0 commit comments

Comments
 (0)