open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.53k stars 1.48k forks source link

Improve scrapers/mdatagen tool to produce more user-friendly code and support user settings #10904

Open dmitryax opened 3 years ago

dmitryax commented 3 years ago

Metrics Builder for Scraper Receivers

Design document: https://docs.google.com/document/d/1OwDbIFlugS1rR0STv7rYBYcUjDZQ45pyVUvOSFfaRp4

Goals

Provide a user-friendly interface for metrics reporting by mdatagen tool

Currently mdatagen tool produces generated_metrics.go files that contain mostly definitions of the metrics taken from metadata.yaml files. Scraper authors have to add some amount of repetitive code to each of the scrapers to fill the metrics with data points and send them downstream. We want to reduce the amount of the repetitive code and provide scraper authors with a simple interface for reporting metrics that will be generated from metadata.yaml files.

Ability to change the default metrics representation by applying user settings

We need a way to customize the default representation of the metrics generated by mdatagen based on user's config. Once we move metrics generation to the Metrics Builder generated by mdatagen, it'll be be possible to customize metrics based on user settings.

As the first step, we want to provide a way to enable or disable any metrics based on user config. This functionality should be encapsulated in the Metrics Builder generated by mdatagen, so scraper authors don't need to deal with user settings. This will also provide a way to introduce optional metrics which are disabled by default just by changing metadata.yaml properties.

Progress

Metrics builder functionality:

Migrated scrapers:

Additional improvements

abhide commented 2 years ago

@dmitryax I would like to work on networkscraper receiver.

abhide commented 2 years ago

@dmitryax I would like to work on filesystemscraper receiver.

dmitryax commented 2 years ago

@abhide sounds good, thanks! I converted the action item into another issue https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/7136

rogercoll commented 2 years ago

@dmitryax I would like to work on the memoryscraper receiver.

github-actions[bot] commented 1 year ago

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 1 year ago

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 1 year ago

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

codeboten commented 3 months ago

transferred issue as mdatagen lives in the core repo now