open-telemetry / open-telemetry/opentelemetry-cpp-contrib

nginx: design question: Why does the sampler default to parent_based=false?

Open
#331 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
153
Forks
184
Avg merge
2d 9h
Merged PRs (30d)
26

Description

Hi,

I'm writing an OpenTelemetry TracerProvider implementation that is a wrapper around Datadog's tracing library. My intention is to eventually add support for that provider in this project's instrumentation/nginx module.

I notice that in the sampling configuration, sampler.parent_based defaults to false, which means that while nginx will extract trace context from an incoming request, it will by default not honor the sampling decision included in that context. Instead it will make its own sampling decision (which defaults to "always on").

Why was this chosen as the default? In the hypothetical Datadog case, I'd prefer parent_based to default to true.

@johanneswuerbach, the author of the configurable sampler.

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 with instrumentation/nginx/src/agent_config.h at the referenced sampling default and review the sampling configuration from pull request #26. Trace how parent_based is applied when incoming context is extracted, then examine the linked OpenTelemetry and Datadog provider context. Done means establishing and documenting whether the default should change.

Written by the indexing model from the issue text.

Assessment

Tech stack
nginx
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.