-
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
mdatagen support for slice and map attributes #18272
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Thanks for reporting this @fredthomsen. Which receiver do you want to use this functionality in? |
We have a custom receiver that we have written to scrape infrastructure data from our monitoring system (this is still pretty alpha) and we were planning on using these resource tags to make some downstream storage routing decisions. Also, I am happy to handle this work if you agree this functionality is desirable. |
Yes, I think this functionality is desirable. Fill free to submit a PR |
Couple of comments: Let's stick to go type definitions in metadata.yaml:
I believe we can make the generated code simple and have the following:
Setting å resource attribute is one operation per scrape, so it's not a performance critical part |
I used resource attributes as an example, but was planning on doing this for metric attributes as well. |
|
@dmitryax PR is out, but I am having to deal with some conversions from |
Note that maps and heterogeneous arrays are not valid attribute values for metrics or resource attributes. This may change in the (maybe near) future, but I'm not sure we should get out ahead of the spec here. /cc @open-telemetry/collector-approvers |
@Aneurysm9 Thanks for pointing to the PR. Looks like it's close to being merged. Given that it's supported in the OTLP, I think we should be good to add the mdatagen support once the spec PR is merged. |
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. |
Add support for map and slice resource and datapoints attributes in order to fulfill open-telemetry#18272.
Add support for map and slice attributes Add support for map and slice resource and datapoints attributes in order to fulfill #18272.
Resolved by #18487 |
Component(s)
cmd/mdatagen
Is your feature request related to a problem? Please describe.
I would like for mdatagen to support generation of code supporting attributes that are maps or slices. I am attempting to add a resource attribute which is a list of strings containing some information that should be acted on by a downstream processor (I realize that #16811 makes this unfeasible at the moment).
Describe the solution you'd like
In the metadata.yml file used by mdatagen, I would like to be able to use a configuration like the following:
And this would generate a function like this for setting the resource attribute:
Similar approach should be taken for metric attributes by providing their RecordXDataPoint functions.
Describe alternatives you've considered
Just use a attribute string that is split by a known deliminator such as
|
.Additional context
The above just assumes a single-level of nesting. With multiple levels specifying the types at each level requires a different way to specify the type.
The text was updated successfully, but these errors were encountered: