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

Scrapers: separate resource attributes in metadata.yaml #7301

Closed
5 tasks done
Tracked by #10904
dmitryax opened this issue Jan 21, 2022 · 9 comments
Closed
5 tasks done
Tracked by #10904

Scrapers: separate resource attributes in metadata.yaml #7301

dmitryax opened this issue Jan 21, 2022 · 9 comments
Assignees
Labels
cmd/mdatagen mdatagen command Stale

Comments

@dmitryax
Copy link
Member

dmitryax commented Jan 21, 2022

Problem

Currently attributes fields in metadata.yaml sometimes are used for both metric and resource attributes. Some scrapers don't specify resource attributes in metadata.yaml, but use resource attribute "hardcoded" in scraper code instead. We need to establish an approach and probably separate the resource attributes from other metric attributes.

Proposal

We can introduce another field in metadata.yaml to specify resource attributes. mdatagen should generate them into a new struct variable ResourceAttributes with alias RA keeping existing Attributes with A alias for metric attributes.

The field can be added to the metadata.yaml in the following format:

resource_attributes:
  <attribute_name>:
    # Optional description
    description: ...
    # Actual attribute string, if not provided `<attribute_name>` used instead, optional.
    value: state
    # Use a variable from `semconv` package instead of defining new attribute name,
    # e.g. "v1.8.0/AttributeCloudAccountID", optional.
    semconv: 

Besides generating ResourceAttributes struct that should be used in scraper code, the updated the new resource_attributes field should be used to generate additional documentation for the scraper. Potentially, if resource_attributes::semconv is set in metadata.yaml, we can also parse the semconv docstrings and auto-generate metric documentation from auto-generated semconv code :)

Action items:

@dmitryax
Copy link
Member Author

@djaglowski @bogdandrutu please let me know what do you think

@djaglowski
Copy link
Member

This all makes sense to me.

One nit - I would support description being required unless semconv is specified.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2022

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
Copy link
Contributor

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 github-actions bot added the Stale label Jan 18, 2023
@dmitryax dmitryax removed the Stale label Jan 18, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2023

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 github-actions bot added the Stale label May 1, 2023
@dmitryax dmitryax removed the Stale label May 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

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 github-actions bot added the Stale label Jul 3, 2023
@djaglowski
Copy link
Member

The remaining checklist items (#8840, #19174) seem to be related but it's not clear to me how this issue is dependent on them. Should we close this issue?

@github-actions github-actions bot removed the Stale label Jul 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

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 github-actions bot added the Stale label Sep 5, 2023
@dmitryax
Copy link
Member Author

dmitryax commented Sep 5, 2023

The remaining checklist items (#8840, #19174) seem to be related but it's not clear to me how this issue is dependent on them. Should we close this issue?

Yes, they are just improvements. We can close this issue

@dmitryax dmitryax closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/mdatagen mdatagen command Stale
Projects
None yet
Development

No branches or pull requests

4 participants