Skip to content

Prevent endless loop if tracer sends each span separately via HTTP #9

Open
@cwe1ss

Description

@cwe1ss

As every HTTP call creates a new span, there could be an endless loop if a tracer sends each span separately (for whatever reason) to its backend system.

The only way to prevent this right now is to tell the HTTP instrumentation that those tracer HTTP calls should not be traced. This can be done in two ways:

  • There's a built-in rule that ignores requests that contain a request property key called ot-ignore. Ideally, this would automatically be set by the tracer. If the tracer allows passing a custom DelegatingHandler a user can also set this himself for each request via:
request.Properties["ot-ignore"] = true;
  • Adding a custom rule that ignores these requests based on their URL. This can be done in ConfigureServices via the following example:
services.Configure<HttpHandlerDiagnosticOptions>(options =>
{
    options.IgnorePatterns.Add(request => request.RequestUri == _tracerUri);
});

Maybe there is a way to prevent this scenario even if none of these things have been done?!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions