ChilliCream / ChilliCream/graphql-platform

OpenTelemetry: Allow filtering field resolver telemetry based on duration

Open
#7,740 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate Area: Performance
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.