Skip to content

Commit bdd6fe4

Browse files
authored
Merge pull request #79 from cisco-open/fix/issues/march-release
Fixing: 1-REST URL paths issue in CLI mode & 2-Add required attributes to resources & spans examples
2 parents 92e73cb + db6cb72 commit bdd6fe4

File tree

4 files changed

+48
-11
lines changed

4 files changed

+48
-11
lines changed

example-definitions/demo/trace-definition.yaml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ rootSpans:
2121
reportingResource: frontend_instance
2222
attributes:
2323
http.method: '"POST"'
24-
http.url: '"/checkout/".concat(UUIDFromStringCounter("checkout"))'
24+
http.target: '"/checkout/".concat(UUIDFromStringCounter("checkout"))'
25+
user_agent.original: '"openid-client/5.4.0 (https://github.com/panva/node-openid-client)"'
26+
http.client_ip: IPv4Sequence("10.134.1.101")
27+
http.scheme: '"https"'
28+
net.host.name: '"opentelemetry-demo.frontend-svc"'
2529
childSpans: ["doCheckout"]
2630
payloadCount: 10
2731
copyCount: 5
@@ -33,17 +37,29 @@ childSpans:
3337
childSpans: ["sendEmail", "convertCurrency"]
3438
attributes:
3539
http.method: '"POST"'
36-
http.url: '"/api/v1/checkout/".concat(UUIDFromStringCounter("checkout"))'
40+
http.target: '"/api/v1/checkout/".concat(UUIDFromStringCounter("checkout"))'
41+
user_agent.original: '"openid-client/5.4.0 (https://github.com/panva/node-openid-client)"'
42+
http.client_ip: IPv4Sequence("10.134.1.101")
43+
http.scheme: '"https"'
44+
net.host.name: '"opentelemetry-demo.checkout-svc"'
3745
- name: sendEmail
3846
reportingResource: email_instance
3947
spanKind: SPAN_KIND_SERVER
4048
attributes:
4149
http.method: '"POST"'
42-
http.url: '"/sendEmail"'
50+
http.target: '"/sendEmail"'
51+
user_agent.original: '"openid-client/5.4.0 (https://github.com/panva/node-openid-client)"'
52+
http.client_ip: IPv4Sequence("10.134.1.101")
53+
http.scheme: '"https"'
54+
net.host.name: '"opentelemetry-demo.email-svc"'
4355
- name: convertCurrency
4456
errorFrequency: 7
4557
reportingResource: currency_instance
4658
spanKind: SPAN_KIND_SERVER
4759
attributes:
4860
http.method: '"GET"'
49-
http.url: '"/currency/convert/".concat(roundRobin(["YEN","BZR"])).concat("/").concat(roundRobin(["EUR", "USD"]))'
61+
http.target: '"/currency/convert/".concat(roundRobin(["YEN","BZR"])).concat("/").concat(roundRobin(["EUR", "USD"]))'
62+
user_agent.original: '"openid-client/5.4.0 (https://github.com/panva/node-openid-client)"'
63+
http.client_ip: IPv4Sequence("10.134.1.101")
64+
http.scheme: '"https"'
65+
net.host.name: '"opentelemetry-demo.currency-svc"'

example-definitions/json/trace-definition.json

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"reportingResource": "frontend_instance",
88
"attributes": {
99
"http.method": "\"POST\"",
10-
"http.url": "\"/checkout/\".concat(UUIDFromStringCounter(\"checkout\"))"
10+
"http.target": "\"/checkout/\".concat(UUIDFromStringCounter(\"checkout\"))",
11+
"user_agent.original": "\"openid-client/5.4.0 (https://github.com/panva/node-openid-client)\"",
12+
"http.client_ip": "IPv4Sequence(\"10.134.1.101\")",
13+
"http.scheme": "\"https\"",
14+
"net.host.name": "\"opentelemetry-demo.frontend-svc\""
1115
},
1216
"childSpans": [
1317
"doCheckout"
@@ -28,7 +32,11 @@
2832
],
2933
"attributes": {
3034
"http.method": "\"POST\"",
31-
"http.url": "\"/api/v1/checkout/\".concat(UUIDFromStringCounter(\"checkout\"))"
35+
"http.target": "\"/api/v1/checkout/\".concat(UUIDFromStringCounter(\"checkout\"))",
36+
"user_agent.original": "\"openid-client/5.4.0 (https://github.com/panva/node-openid-client)\"",
37+
"http.client_ip": "IPv4Sequence(\"10.134.1.101\")",
38+
"http.scheme": "\"https\"",
39+
"net.host.name": "\"opentelemetry-demo.checkout-svc\""
3240
}
3341
},
3442
{
@@ -37,7 +45,11 @@
3745
"spanKind": "SPAN_KIND_SERVER",
3846
"attributes": {
3947
"http.method": "\"POST\"",
40-
"http.url": "\"/sendEmail\""
48+
"http.target": "\"/sendEmail\"",
49+
"user_agent.original": "\"openid-client/5.4.0 (https://github.com/panva/node-openid-client)\"",
50+
"http.client_ip": "IPv4Sequence(\"10.134.1.101\")",
51+
"http.scheme": "\"https\"",
52+
"net.host.name": "\"opentelemetry-demo.email-svc\""
4153
}
4254
},
4355
{
@@ -47,7 +59,11 @@
4759
"spanKind": "SPAN_KIND_SERVER",
4860
"attributes": {
4961
"http.method": "\"GET\"",
50-
"http.url": "\"/currency/convert/\".concat(roundRobin([\"YEN\",\"BZR\"])).concat(\"/\").concat(roundRobin([\"EUR\", \"USD\"]))"
62+
"http.target": "\"/currency/convert/\".concat(roundRobin([\"YEN\",\"BZR\"])).concat(\"/\").concat(roundRobin([\"EUR\", \"USD\"]))",
63+
"user_agent.original": "\"openid-client/5.4.0 (https://github.com/panva/node-openid-client)\"",
64+
"http.client_ip": "IPv4Sequence(\"10.134.1.101\")",
65+
"http.scheme": "\"https\"",
66+
"net.host.name": "\"opentelemetry-demo.currency-svc\""
5167
}
5268
}
5369
]

example-definitions/simple/trace-definition.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ rootSpans:
2121
reportingResource: service_instance
2222
attributes:
2323
http.method: roundRobin(["GET", "POST"])
24-
http.url: roundRobin(["/entry", "/start"])
24+
http.target: roundRobin(["/entry", "/start"])
25+
user_agent.original: '"openid-client/5.4.0 (https://github.com/panva/node-openid-client)"'
26+
net.host.name: '"foobar.opentelemetry-svc"'
27+
http.scheme: '"https"'
2528
childSpans: ["exit"]
2629
payloadCount: 10
2730
copyCount: 5
@@ -34,3 +37,5 @@ childSpans:
3437
db.system: '"mysql"'
3538
db.user: '"mysql"'
3639
db.operation: '"SELECT"'
40+
net.peer.ip: IPv4Sequence("10.134.1.101")
41+
net.peer.name: "'demo.mysql.svc.cluster.local'"

src/main/java/io/opentelemetry/contrib/generator/telemetry/cli/CLIProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ private static PayloadHandler getPayloadHandler(String targetEnvYAML) {
182182
restPayloadHandler.setMetricsURL(targetEnvironmentDetails.getRestURL().getMetricsPath());
183183
}
184184
if (!StringUtils.defaultString(targetEnvironmentDetails.getRestURL().getLogsPath()).isBlank()) {
185-
restPayloadHandler.setMetricsURL(targetEnvironmentDetails.getRestURL().getLogsPath());
185+
restPayloadHandler.setLogsURL(targetEnvironmentDetails.getRestURL().getLogsPath());
186186
}
187187
if (!StringUtils.defaultString(targetEnvironmentDetails.getRestURL().getTracesPath()).isBlank()) {
188-
restPayloadHandler.setMetricsURL(targetEnvironmentDetails.getRestURL().getTracesPath());
188+
restPayloadHandler.setTracesURL(targetEnvironmentDetails.getRestURL().getTracesPath());
189189
}
190190
return restPayloadHandler;
191191
}

0 commit comments

Comments
 (0)