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

Conversation

jack-berg
Copy link
Member

@jack-berg jack-berg commented Jan 5, 2024

The specification defines the concept of resource detectors, which automatically provide resource information based on the environment.

We need to give the user the ability to disable these keys, as they can contain sensitive information (i.e. process.command_line often contains secrets for java) or just not be valuable to the user.

This PR introduces resource.disabled_attribute_keys, an array of strings defining attribute keys from resource detectors that should be disabled. Entries in the array can exactly match an attribute key, or can use a basic pattern matching syntax (inherited from metrics view instrument selection criteria) supporting ? single character any match, and * any number of character any match including none.

The effect is that disabled_attribute_keys acts as a disallow list. We may wish to add an allow list variant in the future, but disabling keys is much more common so let's start there.

@jack-berg jack-berg requested a review from a team January 5, 2024 15:52
# Configure exact match disabled attribute key.
- process.command_args
# Configure wildcard match disabled attribute key(s).
- process.*
Copy link
Member Author

Choose a reason for hiding this comment

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

Discussed in the 1/8/24 configuration SIG:

  • Decided to move this property up to the top level instead of nesting under detectors. This solves any ambiguity issues about whether attributes like telemetry.sdk.* are included in the set, since those may be part of the default resource or provided by resource detectors.
  • Discussed whether wildcard syntax is sufficient. Opened Default config file template that incorporates standard env vars #55 to discuss. I propose we stick with wildcard syntax for now and use user feedback to determine if full regex support is needed before a 1.x release.
  • Discussed whether it would also be useful to match on resource values. Answer is probably? Could add disabled_attribute_values in a separate PR.

@jack-berg jack-berg changed the title Define resource.dectectors.disabled_keys, to disable resource attribute keys provided by detectors Define resource.disabled_attribute_keys, to disable resource attribute keys Jan 8, 2024
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

As discussed in the 29-Apr-2024 meeting, the recommendation here is to follow the same pattern for this and prometheus resource attributes in #67

# 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. ^^

@codeboten codeboten changed the title Define resource.disabled_attribute_keys, to disable resource attribute keys Define resource.detectors.attributes.included/excluded May 8, 2024
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

👍🏻

@jack-berg jack-berg merged commit b450ea7 into open-telemetry:main May 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants