ChilliCream / ChilliCream/graphql-platform
OpenTelemetry: Allow filtering field resolver telemetry based on duration
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Product
Hot Chocolate
Is your feature request related to a problem?
If I understand correctly, when configured with OpenTelemetry, HotChocolate currently creates a ResolveFieldValue activity/span for all async field resolvers, but not for sync field resolvers, presumably to reduce noise and data ingestion costs for the common case of sync resolvers.
I have many fields that are async (ValueTask) only because they perform some async locking. These generally complete synchronously in under 1ms. I would like to exclude these from being exported, just as if they were sync fields.
The solution you'd like
I have tried for several hours now to find a way of not exporting these, using processors and whatnot, but I haven't gotten anywhere. It would be great if HotChocolate provided some way of filtering trace telemetry from the source.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the OpenTelemetry instrumentation that creates the ResolveFieldValue activity/span for async ValueTask field resolvers. Review how resolver duration and export filtering interact with processors, then define a configurable source-side filter so very short async resolvers can be excluded from exported telemetry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend-api-design, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100