Skip to content

Generate process metrics with semconv yaml#160

Closed
braydonk wants to merge 5 commits intoopen-telemetry:mainfrom
braydonk:process_metric_yaml
Closed

Generate process metrics with semconv yaml#160
braydonk wants to merge 5 commits intoopen-telemetry:mainfrom
braydonk:process_metric_yaml

Conversation

@braydonk
Copy link
Copy Markdown
Contributor

@braydonk braydonk commented Jul 4, 2023

No description provided.

@braydonk braydonk requested review from a team July 4, 2023 15:46
@braydonk braydonk marked this pull request as draft July 4, 2023 15:46
@braydonk
Copy link
Copy Markdown
Contributor Author

braydonk commented Jul 4, 2023

Hi @joaopgrassi, I decided to open my changes as a draft PR so you could check my work. This is converting the metrics from process-metrics.md into yaml that semconvgen can use. I also included the example of one generation in the markdown file. I would appreciate if you could take a look and make sure I'm on the right track before I finish off the work and open a properly-formed PR.

Copy link
Copy Markdown
Member

@joaopgrassi joaopgrassi left a comment

Choose a reason for hiding this comment

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

@braydonk looks pretty good to me! I think all is in the right track :)

@@ -0,0 +1,138 @@
groups:
- id: process.cpu
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- id: process.cpu
- id: attributes.process.cpu

I started adding attributes. to attribute_group to easily spot that this is not a span/metric/log convention but just rather a "bag" of attributes to be shared.

type: metric
metric_name: process.context_switches
brief: "Number of times the process has been context switched."
instrument: updowncounter
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
instrument: updowncounter
instrument: counter

It's a counter today, do we want to change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope we want to keep a counter, that was a copy paste mishap 😄 thanks

@braydonk braydonk changed the title WIP generate process metrics with semconv yaml Generate process metrics with semconv yaml Jul 19, 2023
@braydonk braydonk requested a review from joaopgrassi July 19, 2023 14:47
@braydonk braydonk marked this pull request as ready for review July 19, 2023 15:04
Copy link
Copy Markdown
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.

Looks like you have a minor YAMLlint error

Copy link
Copy Markdown
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.

I have a similar comment to the one I left in #89 (review); this PR moves the metrics to YAML and also renames the attributes. If doing each of those changes separately is hard/undesirable, I think we should at least describe this clearly in the PR title, PR description and a changelog entry indicating what changes #51 entails for this set of metrics

@braydonk
Copy link
Copy Markdown
Contributor Author

braydonk commented Aug 15, 2023

@mx-psi I'm kind of confused, which part of this PR needs to be separated? I don't think I intentionally renamed any attributes; I tried to copy them directly from the existing document. If I missed any I will change them back.

@joaopgrassi
Copy link
Copy Markdown
Member

joaopgrassi commented Aug 16, 2023

@braydonk the issue is when changing to YAML, the attributes such as state are not only state but they get the metric "namespace". Ex. process.cpu.state, so it becomes a "breaking change".

There's no easy way to transform the existing metrics/attributes to YAML without this attribute name change, because in YAML the same attribute key cannot be repeated. The only way would be to define them under each metric which is very repetitive/tedious.

I suggest you take the same approach as I did in #89 (comment) and document all the existing attributes vs how they are now with these changes. Plus, the changelog entry + schema file changes (You can see how I did in my PR).

I think that should address @mx-psi concerns.

@braydonk
Copy link
Copy Markdown
Contributor Author

Thanks @joaopgrassi I'll get that fixed soon.

@braydonk
Copy link
Copy Markdown
Contributor Author

I've opened #330 instead. The commit history on this one was really messy with attempts to keep it up to date with main branch, so I started a new clean PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants