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

[Metrics builder] Move resource creation to the generated code #8555

Merged
merged 1 commit into from
Mar 24, 2022

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Mar 19, 2022

This change updates metrics builder to fully control creation of the pdata.Metrics object, scraper author don't need to create and pass it to MetricsBuiler.Emit function anymore.

This change also moves definition of resource attributes to metadata.yaml which is used to generate attribute helper that can be used in the scraper.

Closes: #8358

Also this is the first PR towards #7301.

The following items will be resolved as follow-up PRs:

  • Add sem ver support in metadata.yaml
  • Define resource schema in metadata.yaml and automatically set it up instead of using wrapBySchemaURLSetterConsumer

@dmitryax dmitryax requested a review from a team March 19, 2022 23:16
@dmitryax dmitryax force-pushed the metric-builder-resource branch 15 times, most recently from 3b3ca32 to 7592d08 Compare March 21, 2022 03:28
@dmitryax
Copy link
Member Author

@djaglowski @codeboten please let me know what do you think about this approach to #8358

CHANGELOG.md Outdated Show resolved Hide resolved
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.

Overall I think this looks really good. Just a couple of things that need to be fixed w/ the generated documentation.

receiver/couchdbreceiver/documentation.md Show resolved Hide resolved
receiver/rabbitmqreceiver/documentation.md Show resolved Hide resolved
receiver/zookeeperreceiver/documentation.md Show resolved Hide resolved
Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

LGTM. This is a really nice solution to two problems.

This change updates metrics builder to fully control creation of the metrics object. Scraper author don't need to create pdata.Metrics object and pass it to MetricsBuiler.Emit function.

This change also moves definition of resource attributes to metadata.yaml which is used to generate attribute helper that can be used in the scraper.
313873
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.

[Metrics builder] Generate whole pdata.Metrics object
5 participants