open-telemetry / opentelemetry-proto

OpenTelemetry protocol (OTLP) specification and Protobuf definitions
https://opentelemetry.io/docs/specs/otlp/
Apache License 2.0
606 stars 263 forks source link

Improve metrics.proto by mentioning Resource Attributes and Scope #518

Closed krisztianfekete closed 4 months ago

krisztianfekete commented 11 months ago

I think metrics.proto would benefit from listing Resource Attributes and Scope.

I am writing a blog on a related topic and would like to cross-reference the illustration in the proto file with the logging exporter.

I also added attribute to the key-value pairs.

I am thinking of something like this:

//     Metric
//  +--------------------+
//  |name                |
//  |resource attributes |
//  |description         |
//  |unit                |     +------------------------------------+
//  |data                |---> |Gauge, Sum, Histogram, Summary, ... |
//  +--------------------+     +------------------------------------+
//
//    Data [One of Gauge, Sum, Histogram, Summary, ...]
//  +-----------+
//  |...        |  // Metadata about the Data.
//  |points     |--+
//  +-----------+  |
//                 |      +---------------------------+
//                 |      |DataPoint 1                |
//                 |      |                           |
//                 |      |attribute                  |
//                 v      |+------+------+   +------+ |
//              +-----+   ||label |label |...|label | |
//              |  1  |-->||value1|value2|...|valueN| |
//              +-----+   |+------+------+   +------+ |
//              |  .  |   |+-----+                    |
//              |  .  |   ||value|                    |
//              |  .  |   |+-----+                    |
//              |  .  |   +---------------------------+
//              |  .  |                   .
//              |  .  |                   .
//              |  .  |                   .
//              |  .  |   +---------------------------+
//              |  .  |   |DataPoint M                |
//              |  .  |   |                           |
//              |  .  |   |attribute                  |
//              +-----+   |+------+------+   +------+ |
//              |  M  |-->||label |label |...|label | |
//              +-----+   ||value1|value2|...|valueN| |
//                        |+------+------+   +------+ |
//                        |+-----+                    |
//                        ||value|                    |
//                        |+-----+                    |
//                        +---------------------------+

Happy to open a PR as well. What do you think?

tigrannajaryan commented 11 months ago

+1. I think it would be useful. Please use the same ASCII chart style for consistency.