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

Define resource.detectors.attributes.included/excluded #64

Merged
merged 4 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,13 @@ resource:
service.name: !!str "unknown_service"
# Configure the resource schema URL.
schema_url: https://opentelemetry.io/schemas/1.16.0
# Configure disabled resource attribute keys provided by resource detectors.
#
# Attribute keys are evaluated to match disabled_attribute_keys in the following manner:
# * If the value of the attribute key exactly matches.
# * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.
disabled_attribute_keys:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this could be an included/excluded list under attributes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I like that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scratch that. .resource.attributes is currently a map with key values which directly reflect the resource attributes. Its odd to have special-case included and excluded keys which have values following different rules.

Lets nest included and excluded under something which indicates that we're referring to attributes from resource detectors. Maybe something like:

resource:
  detectors:
    attributes:
      included:
        - foo*
        - b?r
      excluded:
        - baz

Nesting included and excluded under .resource.detectors.attributes because:

  • We might want to configure other things related to resource detectors
  • If included and excluded are directly under .resource.detectors, then its not clear that we're including / excluding attributes vs. detectors themselves

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a commit which reflect this. ^^

# Configure exact match disabled attribute key.
- process.command_args
# Configure wildcard match disabled attribute key(s).
- process.*
6 changes: 6 additions & 0 deletions schema/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
},
"schema_url": {
"type": "string"
},
"disabled_attribute_keys": {
"type": "array",
"items": {
"type": "string"
}
}
},
"$defs": {
Expand Down
Loading