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

BREAKING: Generate System metrics semconv from YAML + move attributes to their own namespace #89

Merged

Conversation

joaopgrassi
Copy link
Member

@joaopgrassi joaopgrassi commented Jun 6, 2023

Closes #73

This PR does:

  • Moves the system metrics definitions to the YAML model file.
  • Because of the "limitations" of tooling AND because the existing metrics share attributes with the same name, this PR also changes the attribute namespaces according with the decision from Should metric attributes be required to be namespaced? #51

Summary of breaking changes

A summary of the changes can be found in this comment. It can also be seen in other "formats" in the changelog + schema file.


Still need resolution from #51. There are several attributes in system metrics (e.g., state) that are used in different metrics but with different enum values.

If we want to keep the markdown output as "short" state, we will probably have to see what can be done with the tooling. With the current version of the PR, I have the attributes "namespaced" by using the attribute_group feature in order to re-use the attribute across metrics.

@joaopgrassi joaopgrassi marked this pull request as ready for review June 9, 2023 12:24
@joaopgrassi joaopgrassi requested review from a team June 9, 2023 12:24
Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

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

As far as what was done in this PR, this LGTM.

  • I agree with the namespaces you chose for attributes, as they line up w/ the metrics.
  • I agree with the structure/breakdown in the YAML
  • I think the final markdown looks good.

We should do one of two things with this PR:

  1. Open a (blocking) bug about providing guidance on how to deal with the breaking changes in system metrics.
  2. Advise instrumentation to continue using the older System metrics specification until the system metrics working group has had a chance to walk through their issues and declare this stable.

What does everyone think?

@arminru
Copy link
Member

arminru commented Aug 1, 2023

This needs to be rebased after #99 is merged (or the other way round).

@joaopgrassi
Copy link
Member Author

I rebased and added the new metrics introduced in #99.

@jsuereth As far as the plan goes, I think option 2 makes sense:

Advise instrumentation to continue using the older System metrics specification until the system metrics working group has had a chance to walk through their issues and declare this stable.

I think once the working group has looked at these metrics and decided they are good, then we can follow up with option 1 and add a issue to track how we will communicate the breaking change and add instructions.

Additionally, we can also add a Notice to the markdown here, saying these have changed and for instrumentations to continue to use the previous version (point to the last release version). What do you think?

model/metrics/system-metrics.yaml Outdated Show resolved Hide resolved
model/metrics/system-metrics.yaml Outdated Show resolved Hide resolved
@frzifus
Copy link
Member

frzifus commented Aug 2, 2023

Just to verify if I understood it correctly, this PR changes the attribute values of example system.processes from e.g.: running to system.processes.running ?

Copy link
Member

@AlexanderWert AlexanderWert left a comment

Choose a reason for hiding this comment

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

LGTM. Only two minor questions regarding state value members

model/metrics/system-metrics.yaml Show resolved Hide resolved
model/metrics/system-metrics.yaml Show resolved Hide resolved
@ChrsMark ChrsMark mentioned this pull request Aug 4, 2023
@dmitryax
Copy link
Member

dmitryax commented Aug 9, 2023

In my opinion, it's hard to track the breaking changes in this PR. I'd suggest separate PR's: 1 for YAML generation with no changes and another one for the adoption of #51. But I'm good to merge as is if @open-telemetry/specs-semconv-maintainers disagree

@joaopgrassi
Copy link
Member Author

joaopgrassi commented Aug 10, 2023

@dmitryax

In my opinion, it's hard to track the breaking changes in this PR. I'd suggest separate PR's: 1 for YAML generation with no changes and another one for the adoption of #51.

I definitely agree, but the "problem" is that since multiple metrics use the same attribute key with different semantics there's no way to define them once and share in YAML. The only way I see to convert the existing metrics to YAML keeping the attributes as-is is to duplicate them all over in the YAML definition. If folks think that's the best way to go, I can do that. But it's not a trivial amount of work for just being removed right after.

I will work on this now, to add a changelog entry + the schema file that should highlight the breaking changes more easily. Maybe that helps.

@joaopgrassi joaopgrassi changed the title Generate System metrics semconv from YAML + move attributes to their own namespace BREAKING: Generate System metrics semconv from YAML + move attributes to their own namespace Sep 7, 2023
@joaopgrassi
Copy link
Member Author

joaopgrassi commented Sep 7, 2023

@dmitryax as we discussed in the SIG meeting yesterday, I changed the PR to revert the system.processes.* pluralization change. The PR is back now to "just" moving the conventions to YAML + introducing the namespaces for the attributes.

I updated the changelog/schema/my wall-of-text comment with the breaking changes summary to reflect this.

Once you create the issue about your concern with the network attributes, please link it here.

@dmitryax
Copy link
Member

dmitryax commented Sep 11, 2023

@joaopgrassi I submitted #308. We should probably do the same for other metric groups

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

LGTM to unblock further changes

@joaopgrassi joaopgrassi requested a review from a team September 12, 2023 09:41
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

cc @open-telemetry/semconv-system-approvers the cpu attribute got renamed to system.cpu.logical_number (see more in #89 (comment) ), please speak out if you disagree with the change

@ChrsMark
Copy link
Member

cc @open-telemetry/semconv-system-approvers the cpu attribute got renamed to system.cpu.logical_number (see more in #89 (comment) ), please speak out if you disagree with the change

Don't want to block the merge of this but shouldn't the system.cpu.logical_number be under the host. namespace since it's a resource attribute? So it would be host.cpu.logical_number or host.cpu.id similar to what we have for the host.id?

That's related to open-telemetry/opentelemetry-collector-contrib#26533 (comment).

In order to not keep this one blocked we can revisit this as part of System SIG along with the others' attributes stabilization.

@joaopgrassi
Copy link
Member Author

joaopgrassi commented Sep 12, 2023

In order to not keep this one blocked we can revisit this as part of System SIG along with the others' attributes stabilization.

@ChrsMark I added your concerns to #308 where we are grouping things to re-visit. Thanks!

@joaopgrassi
Copy link
Member Author

joaopgrassi commented Sep 12, 2023

Discussed how to move forward with this PR in the semconv sig meeting (Sept 11th).

  • The system semconv WG agrees with this PR and gave the approvals to merge.
  • Migration plan: I will send a PR to update the system-metrics.md document and add a section similar to what we have in the HTTP about instrumentations to keep using the old version while it's being stabilized. System semconv WG will then fill in the gaps of the actual migration plan

@open-telemetry/specs-semconv-approvers @open-telemetry/specs-semconv-maintainers this is good to merge!

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.

Move metric definitions to YAML - System Metrics
10 participants