Skip to content

Commit 483b64c

Browse files
authored
Eclipse temurin 25 update (#1643)
Replaces #1597 Signed-off-by: Jay DeLuca <[email protected]>
1 parent 2b87200 commit 483b64c

File tree

4 files changed

+37
-34
lines changed

4 files changed

+37
-34
lines changed

examples/example-exporter-opentelemetry/oats-tests/agent/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM eclipse-temurin:21.0.8_9-jre@sha256:66bb900643426ad01996d25bada7d56751913f9cec3b827fcb715d2ec9a0fbfc
1+
FROM eclipse-temurin:25-jre@sha256:74d5c631e5db5a44e7f5a2dd49f93f0c6f7b8c22c1dc1b8e1caec7009872c5c3
22

33
COPY target/example-exporter-opentelemetry.jar ./app.jar
44
# check that the resource attributes from the agent are used, epsecially the service.instance.id should be the same
5-
ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.8.0/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar
5+
ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.21.0/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar
66
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar
77

88
#ENTRYPOINT [ "java", "-Dotel.javaagent.debug=true","-jar", "./app.jar" ] # for debugging
Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,51 @@
11
#!/usr/bin/env python3
2-
3-
"""This script is used to check if the service instance id is present in the exported data
4-
The script will return 0 if the service instance id is present in the exported data"""
5-
2+
"""
3+
Check if the service instance id is present in the exported data.
4+
Returns 0 if the service instance id is present in the exported data.
5+
"""
66
import json
77
import urllib.parse
88
from urllib.request import urlopen
99

1010

11-
def get(url):
12-
global response, res
11+
def get_json(url):
1312
with urlopen(url) as response:
14-
# read the response
15-
res = response.read()
16-
# decode the response
17-
res = json.loads(res.decode("utf-8"))
18-
return res
13+
return json.loads(response.read().decode("utf-8"))
1914

2015

21-
res = get(" http://localhost:9090/api/v1/query?query=target_info")
16+
def main():
17+
# Query Prometheus for target_info
18+
res = get_json("http://localhost:9090/api/v1/query?query=target_info")
2219

23-
# uncomment the following line to use the local file instead of the url - for debugging
24-
# with open('example_target_info.json') as f:
25-
# res = json.load(f)
20+
# Uncomment for local debugging
21+
# with open('example_target_info.json') as f:
22+
# res = json.load(f)
2623

27-
values = list(
28-
{
24+
instance_ids = {
2925
r["metric"]["instance"]
3026
for r in res["data"]["result"]
31-
if not r["metric"]["service_name"] == "otelcol-contrib"
27+
if r["metric"].get("service_name") != "otelcol-contrib"
3228
}
33-
)
34-
print(values)
29+
instance_ids = list(instance_ids)
30+
31+
print(f"Instance ids found:{instance_ids}")
32+
if len(instance_ids) > 1:
33+
print("More than one instance id found")
34+
print(res)
35+
36+
# Both the agent and the exporter should report the same instance id
37+
assert len(instance_ids) == 1, "Expected exactly one instance id"
38+
39+
query = f'target_info{{instance="{instance_ids[0]}"}}'
40+
encoded_query = urllib.parse.quote_plus(query)
41+
res = get_json(f"http://localhost:9090/api/v1/query?query={encoded_query}")
3542

36-
# both the agent and the exporter should report the same instance id
37-
assert len(values) == 1
43+
infos = res["data"]["result"]
44+
print(infos)
3845

39-
path = f'target_info{{instance="{values[0]}"}}'
40-
path = urllib.parse.quote_plus(path)
41-
res = get(f"http://localhost:9090/api/v1/query?query={path}")
46+
# They should not have the same target info (e.g. only the agent has telemetry_distro_name)
47+
assert len(infos) == 2, "Expected two target info results"
4248

43-
infos = res["data"]["result"]
44-
print(infos)
4549

46-
# they should not have the same target info
47-
# e.g. only the agent has telemetry_distro_name
48-
assert len(infos) == 2
50+
if __name__ == "__main__":
51+
main()

examples/example-exporter-opentelemetry/oats-tests/http/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:21.0.8_9-jre@sha256:66bb900643426ad01996d25bada7d56751913f9cec3b827fcb715d2ec9a0fbfc
1+
FROM eclipse-temurin:25-jre@sha256:74d5c631e5db5a44e7f5a2dd49f93f0c6f7b8c22c1dc1b8e1caec7009872c5c3
22

33
COPY target/example-exporter-opentelemetry.jar ./app.jar
44

examples/example-native-histogram/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3"
22
services:
33
example-application:
4-
image: eclipse-temurin:21.0.8_9-jre@sha256:66bb900643426ad01996d25bada7d56751913f9cec3b827fcb715d2ec9a0fbfc
4+
image: eclipse-temurin:25-jre@sha256:74d5c631e5db5a44e7f5a2dd49f93f0c6f7b8c22c1dc1b8e1caec7009872c5c3
55
network_mode: host
66
volumes:
77
- ./target/example-native-histogram.jar:/example-native-histogram.jar

0 commit comments

Comments
 (0)