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

Improve metric markdown generation #1040

Open
joaopgrassi opened this issue Jun 5, 2023 · 5 comments
Open

Improve metric markdown generation #1040

joaopgrassi opened this issue Jun 5, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@joaopgrassi
Copy link
Member

Support to generate markdown for metrics from yaml was added in open-telemetry/build-tools#79.

I'm currently moving the existing "hard-coded" metric semantic convention from the markdown files to yaml and I noticed a few things that can be improved:

  • Generate metric name/header/description automatically:

For example, in the runtime-environment-metrics the metrics are organized as such:

### Metric: `process.runtime.jvm.memory.usage` (1)

This metric is [recommended][MetricRecommended]. (2)
...

When moving the metrics to YAML, to be able to achieve the same output as above, I need to manually add the (1) header and the recommendation.

  1. The header we can generate, since we have all the information
  2. The "This metric is recommended.." I don't think we have this field in the data model, so we might need to include it

In the end, it would be great if the only thing required to generate consistent markdown, are the placeholders such as

<!-- semconv metric.system.cpu.time(metric_table) -->
<!-- endsemconv -->

<!-- semconv metric.system.cpu.time(full) -->
<!-- endsemconv -->

And that would generate

### Metric: `process.runtime.jvm.memory.usage`

This metric is [recommended][MetricRecommended].

<metric table>

<metric attribute table>
@joaopgrassi joaopgrassi added the enhancement New feature or request label Jun 5, 2023
@joaopgrassi
Copy link
Member Author

We have also the status which has a field in YAML that we can use to render in markdown, instead of "hard-coding" it. In some cases the document has mixed statuses like the http metrics semconv and it would be nice if that can also be auto-generated from the YAML definitions.

@Oberon00
Copy link
Member

Note that the same / something very similar applies to other types of attributes: #1086

@lmolkova
Copy link
Contributor

lmolkova commented Mar 12, 2024

@jsuereth
Copy link
Contributor

jsuereth commented May 9, 2024

@joaopgrassi I'd love to see your request moved over into semconv repo, as I think you could implement it after #1000 is merged.

@jsuereth jsuereth transferred this issue from open-telemetry/build-tools May 15, 2024
@jsuereth
Copy link
Contributor

@joaopgrassi I think you should be able to expand support for metric tables directly in semconv via the JINJA templates now.

@jsuereth jsuereth added help wanted Extra attention is needed good first issue Good for newcomers and removed help wanted Extra attention is needed labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Template Generation Fixes
Development

No branches or pull requests

5 participants