Skip to content

Give more information to samplers for http server instrumentations #4111

@xrmx

Description

@xrmx

Or pass the request attributes at span creation instead of adding them later. Some http instrumentation make it hard to do sampling because the sampler does not have enough information (e.g. user-agent, url path) in the attributes.

These are status as of be56431 (there are some in flight PRs for adding stable semconv but they are not changing this):

  • aiohttp-server, needs fixes: attributes added after span creation
  • asgi, has user_agent and url.path
  • django, has user_agent and url.path
  • falcon, needs fixes: attributes added after span creation
  • fastapi, see asgi
  • flask, has user and url.path
  • pyramid, needs fixes: attributes added after span creation
  • starlette, see asgi
  • tornado, needs fixes: attributes added after span creation
  • wsgi, has user_agent and url.path

Most of the time this would be matter of moving the call that gather the attributes for the request before the span creation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions