Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processor/spanprocessor] Implement context-aware/structured span processing capabilities #35934

Closed
lopes-felipe opened this issue Oct 22, 2024 · 1 comment
Labels
enhancement New feature or request needs triage New item requiring triage processor/span

Comments

@lopes-felipe
Copy link
Contributor

lopes-felipe commented Oct 22, 2024

Component(s)

processor/span

Is your feature request related to a problem? Please describe.

Currently, this processor's span transformation capabilities are based on regex and/or attribute names without any contextual awareness of their origin (e.g., SQL Query, Redis Command, Web Request, etc.).

This makes it hard to apply more complex processing logic, such as removing comments or collapsing parameters for IN-clauses (ref), as well as extracting any common attribute defined by the semantic conventions (ref).

Describe the solution you'd like

The ability to apply transformation logic to the spans, based on a configuration. Ex:

span:
  name:
    sql:
      comments: <keep|remove>
      alias: <keep|remove> # whether SQL aliases ("AS") should be truncated
      space_between_parentheses: <keep|remove> # IN ( ? ) | IN (?)
      ...
  attributes:
    sql:
      table_name: <insert|upsert> # db.collection.name (users; dbo.products)
      operation: <insert|upsert> # db.operation.name (SELECT; INSERT; UPDATE; DELETE; CREATE; mystoredproc)
      query_summary: <insert|update> # db.query.summary (SELECT orders; INSERT shipping_details; UPDATE users)
      ...

Describe alternatives you've considered

No response

Additional context

This feature is based on this Datadog-specific obfuscation process PR. However, the idea here is to provide something similar but much more flexible, complete, and vendor-agnostic.

I can definitely take this, if approved :)

@lopes-felipe lopes-felipe added enhancement New feature or request needs triage New item requiring triage labels Oct 22, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage processor/span
Projects
None yet
Development

No branches or pull requests

1 participant