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

Open
inigohu opened this issue May 31, 2023 · 6 comments · May be fixed by #5133
Open

otelgrpc: Allow adding custom attributes to otelgrpc metrics #3894

inigohu opened this issue May 31, 2023 · 6 comments · May be fixed by #5133
Labels

Comments

@inigohu
Copy link

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.

@inigohu inigohu added area: instrgen Related to the instrgen package enhancement New feature or request labels May 31, 2023
@MrAlias MrAlias added instrumentation: otelgrpc and removed area: instrgen Related to the instrgen package labels Jun 13, 2023
@rehanpfmr
Copy link

@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
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 inigohu linked a pull request Feb 19, 2024 that will close this issue
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
Author

inigohu commented May 9, 2024

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

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.

6 participants