New transform: trace to metric #12710
Labels
domain: metrics
Anything related to Vector's metrics events
domain: traces
Anything related to Vectors' trace events
type: feature
A value-adding code addition that introduce new functionality.
A note for the community
Use Cases
There's a very real way in which metric instrumentation is redundant with tracing instrumentation. For example, the
http.{client,server}.duration
metrics defined in the semantic conventions can easily be generated from spans, aggregating along the right attributes.With some additional VRL functionality, you could imagine some fancier aggregations. For example, total number of SQL queries made in processing an HTTP request, aggregated along the typical HTTP attributes (method, path, status) and database attributes (DB, table, query type). Or total time spent in database queries.
Attempted Solutions
Traces are too new in Vector to have any attempted solutions. However, the spanmetricsprocessor in the OpenTelemetry collector is a spiritual attempt. With VRL, the Vector implementation can be a lot more capable, especially if applied after collecting all spans that make up a trace.
Proposal
Create a new transform that has trace as input and metric as output.
This is vague and fairly inelegant, but a really rough take on what a configuration might look like:
[0] https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md
[1] https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md
References
Related to #12029.
Version
No response
The text was updated successfully, but these errors were encountered: