build-tools
build-tools copied to clipboard
Improve metric markdown generation
Support to generate markdown for metrics from yaml was added in #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.
- The header we can generate, since we have all the information
- 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>