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

otelgrpc: Allow adding custom attributes to otelgrpc metrics #3894

Closed
inigohu opened this issue May 31, 2023 · 6 comments · Fixed by #5133
Closed

otelgrpc: Allow adding custom attributes to otelgrpc metrics #3894

inigohu opened this issue May 31, 2023 · 6 comments · Fixed by #5133
Labels
Milestone

Comments

@inigohu
Copy link
Contributor

inigohu commented May 31, 2023

Problem Statement

The otelgrpc instrumentation does not allow adding custom attributes to the metrics.

Proposed Solution

The otelhttp instrumentation, for example, provides a labeler for adding custom attributes.

@rehanpfmr
Copy link
Contributor

@inigohu @MrAlias
Does this need to be updated on all instrumentations?
Let me know instrumentations which can be updated, I can take it.

@inigohu
Copy link
Contributor Author

inigohu commented Jan 15, 2024

I see that the new otelgrpc.StatsHandler has been implemented. Would it be possible to include this feature? Maybe make gRPCContextKey and gRPCContext public to pass custom attributes? WDYT @pellared

@upalinski
Copy link

Any updates on this? Had to copy-paste stats handler and allow custom attributes to be passed outside.

@dmathieu
Copy link
Member

dmathieu commented Feb 5, 2024

I believe a similar approach to what's being done in net/http (the Labeler mentioned in the issue's description) would be fine, if you want to open a PR.

inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Feb 19, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Feb 20, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Feb 20, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Feb 21, 2024
@duongcongtoai
Copy link

Hi, is there any update on this :D it is really useful for our usecase to tag extra labels to our grpc traffic

inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue May 9, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue May 9, 2024
@inigohu
Copy link
Contributor Author

inigohu commented May 9, 2024

Hi @dmathieu, I've opened a PR if you want to take a look at it.

inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jun 3, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jun 4, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jun 4, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jun 5, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jun 5, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jun 6, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jun 6, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jul 10, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jul 31, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Jul 31, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Aug 2, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Aug 2, 2024
inigohu added a commit to inigohu/opentelemetry-go-contrib that referenced this issue Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants