-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
frontend: add more attributes to the spans #1322
base: main
Are you sure you want to change the base?
Conversation
c776528
to
478b6ec
Compare
@@ -72,13 +64,8 @@ func TestMiddlewareTracing(t *testing.T) { | |||
} { | |||
t.Run(tc.name, func(t *testing.T) { | |||
// Setup the testing tracer. | |||
inMemoryExporter := tracetest.NewInMemoryExporter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi @frzifus I've reworked a bit the test framework for tracing. let me know what you think.
478b6ec
to
58e632f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Just a minor question on the ID convention part.
|
||
var attrs []attribute.KeyValue | ||
if a.subscriptionID != "" { | ||
attrs = append(attrs, attribute.String("aro.subscription_id", a.subscriptionID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sticking to subscription_id
or subcription.id
? I can't remember if we had a conversion on the ID convention or not. Remind me if we did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point and I don't remember that we decided explicitly for one or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but since we already have aro.correlation.id
, it's probably best to stick with the '.' approach. I'll update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok after thinking a bit more, I have taken a mixed approach. We can discuss more next week (nothing urgent here).
c1b0ebe
to
10a7824
Compare
This change modifies the existing middlewares to add new span attributes and be consistent with logging. In practice, the following attributes are added: * `cloud.provider` (always `Azure`) [1] * `cloud.resource_id` [1] * `aro.subscription.id` * `aro.subscription.state` * `aro.resource_group.name` * `aro.resource.name` * `aro.api_version` The following attributes have also been renamed to better match the guidelines on attribute naming (TL;DR: use dot separators to delimit namespaces and underscores for multi-word names): * `aro.correlation.id` -> `aro.correlation_id` * `aro.client.request.id` -> `aro.client.request_id` * `aro.request.id` -> `aro.request_id` [1] https://pkg.go.dev/go.opentelemetry.io/otel@v1.34.0/semconv/v1.27.0 Signed-off-by: Simon Pasquier <spasquie@redhat.com>
10a7824
to
907c7e1
Compare
Everything looks fine for now. Will sync up on the trace IDs next week to move this this PR forward. |
What this PR does
This change modifies the existing middlewares to add span attributes and be consistent with logging.
The following attributes are added:
cloud.provider
(alwaysAzure
) [1]cloud.resource_id
[1]aro.subscription.id
aro.subscription.state
aro.resource_group.name
aro.resource.name
aro.api_version
The following attributes have also been renamed to better match the
guidelines on attribute naming (TL;DR: use dot separators to delimit
namespaces and underscores for multi-word names):
aro.correlation.id
->aro.correlation_id
aro.client.request.id
->aro.client.request_id
aro.request.id
->aro.request_id
[1] https://pkg.go.dev/go.opentelemetry.io/otel@v1.34.0/semconv/v1.27.0
Jira:
Link to demo recording:
Special notes for your reviewer