Skip to content
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

SpanMetrics converter: include http.request.status_code as metric attribute #22011

Closed
mariomac opened this issue May 16, 2023 · 6 comments
Closed

Comments

@mariomac
Copy link

mariomac commented May 16, 2023

Component(s)

processor/spanmetrics

Is your feature request related to a problem? Please describe.

After converting my HTTP request traces to metrics, we expected that the status_code field contained the HTTP response status (e.g. 200, 404, etc...). After digging into it, we realized that it actually contains the Unset, Ok and Error values about the Span status.

Describe the solution you'd like

I'd suggest that status_code metrics attribute value is set from http.request.status_code (or e.g. rpc.grpc.status_code for GRPC services).

Describe alternatives you've considered

No response

Additional context

No response

@mariomac mariomac added enhancement New feature or request needs triage New item requiring triage labels May 16, 2023
@github-actions github-actions bot added the processor/spanmetrics Span Metrics processor label May 16, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@albertteoh
Copy link
Contributor

status_code is part of the OTEL trace specification, and I think it's important to stay true to that; moreover, because that value is always present, we can rely on it as one of the "standard" dimensions of a metric.

On the other hand, http.request.status_code is not guaranteed to be present, so I don't think we can rely on it for status codes.

Have you tried adding http.request.status_code to the dimensions configuration of the spanmetricsconnector? Example: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/connector/spanmetricsconnector/README.md#examples.

@mariomac
Copy link
Author

No I didn't try, as I was working on a managed instance. But thank you for the explanation and the exposition of the solution!

@github-actions
Copy link
Contributor

Pinging code owners for connector/spanmetrics: @albertteoh @kovrus. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@andrzej-stencel andrzej-stencel removed the needs triage New item requiring triage label Jun 29, 2023
@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Aug 29, 2023
@github-actions
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants