-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/dockerstats] Revisit configuration for setting attributes from container labels and env vars #13848
Comments
Pinging code owners: @rmfitzpatrick. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@dmitryax For item 1, I would say I'd be happy to work on these some time soon. If I was codeowner of this component I would get pinged for stuff like this too, I'd be happy to put my hand up for that. |
@jamesmoessis we already have a PR with a more generic approach #14537 It would be great if we can have a consistent config interface for such use cases, in the docker receiver, k8s attributes processor and others |
Looks like that PR went stale. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello! We are interested as well in this feature and I am ready to contribute if we decide which is the desired behavior and design/config. 😄 Context of the issueFrom my point of view, the source of the complexity is that
Introducing regexes to select labels we would need a mechanism to rename the selected attributes (that are not a fixed list). Unfortunately, this is not straightforward. For example, the k8sAttributesProcessor allows to do that, but the configuration is a bit complex and difficult to document (having at the same time I went through the code and the old PR and I see two possible paths forward. OPTION 1 Drop renaming feature, embrace filterset to select the attributes/envVarsMy favorite approach would be to have a simple configuration for the type Config struct { (names can be discussed directly in the PR)
...
includeLabels labelMatchConfig `mapstructure:"include_labels"`
includeEnvVars envVarMatchConfig `mapstructure:"include_env_vars"`
...
}
type labelMatchConfig struct {
filterset.Config `mapstructure:",squash"`
labelsNames []string `mapstructure:"keys"`
} We would merely select which labels/env to include with regexes, no renaming will be possible in this case. PROS:
CONS:
In this case, we would not align the implementation of the OPTION 2 Support regexes when extracting and renaming attributes, align k8s attribute processorThe other approach would be to implement a configuration as the one suggested in the old PR. It would be feature complete, but more complex to configure and develop. In that case, I think we should break down the duties of such a configuration:
WDYT? 🤔 |
@paologallinaharbur I like option 2, with something similar to what @dmitryax suggested in his comment on #14537. Ideally the same interface or struct is used across dockerstats/podman/k8s components. Option 1 is nice and simple, but I wouldn't want to take the ability to name the attribute keys away from the user. |
In option 1 we would not take away such a possibility. We would delegate it to another component, for example, the processors:
resource:
attributes:
- key: "new.name"
from_attribute: "metric.name.to.be.modified"
action: upsert
- key: "metric.name.to.be.modified"
action: delete In this way:
I am worried that to cover an unusual use case we would cause the implementation and the configuration to be more complex for everyone. However, as I stated before mine is just a preference and I am quite new to the project. |
I'm still not super convinced that there's much problem with how it works right now to justify doing anything except maybe making an alias for the name so it says I see where you are coming from @paologallinaharbur but I still think option 1 is a little bit inconvenient for people using the current feature. Would like to hear @dmitryax's thoughts on this too. |
The biggest problem with the @paologallinaharbur there is a big effort lead by @TylerHelmuth to migrate the existing configurations for components like |
The biggest issue I see right now is that you cannot include "all" labels and you need to specify them one by one in the config.
Thanks for the heads up, I'll check it out and try to come up with a different proposal leveraging it |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Given that we have
But it's still a pretty complicated API. I'll submit another issue where we can come up with a unified filtering interface that can be applied in all collector configuration parts |
@dmitryax FYI we have the building blocks for this as it is something I needed for #18642. All components can use |
@TylerHelmuth, the problem is that we need a way to filter out external data sets (slices and maps), not OTLP objects. Do you think it's something OTTL should be used for? |
I need to comprehend this issue more, but in general OTTL the language is written to treat |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
container_labels_to_metric_labels
andenv_vars_to_metric_labels
names are confusing. The container labels and env var key/values are added as Resource attributes not data point attributes, which is right, but configuration names are misleading.container_labels_to_metric_labels
andenv_vars_to_metric_labels
allows users to set only known predefined set of labels or env vars. For example, if users want to set all container labels as resource attributes, they cannot do that with current configuration. I would suggest to make the configuration interface more flexible. We can align it with existing functionality of k8s attributes processor with does a similar thing:opentelemetry-collector-contrib/processor/k8sattributesprocessor/config.go
Line 97 in d428e1c
The text was updated successfully, but these errors were encountered: