Separate Dimensions for calls and duration metrics in Span Metrics #36805
Description
Component(s)
connector/spanmetrics
Is your feature request related to a problem? Please describe.
Currently, the span metrics connector allows users to specify dimensions to extract from span data when converting to metrics. However, these dimensions are applied uniformly to both the calls (counter) and duration (histogram) metrics. This feature request proposes an enhancement to allow users to specify dimensions separately for each metric type, providing more granular control over the metrics configuration.
Describe the solution you'd like
Introduce a configuration option within the span metrics connector that allows users to specify which metrics (calls or duration) the dimensions should be applied to. This would enable users to:
- Apply dimensions extraction to both metrics.
- Apply dimensions extraction only to the calls (counter) metric.
- Apply dimensions extraction only to the duration (histogram) metric.
Before
connectors:
spanmetrics:
dimensions:
- name: "http.method"
- name: "http.status_code"
After, breaking change since component is still in Alpha
status
connectors:
spanmetrics:
dimensions:
global: # Apply to all
- name: "http.method"
calls: # Optional, specific to calls (counter) metrics
- name: "host.name"
duration: # Optional, specific to duration (histogram) metrics
- name: "http.status_code"
OR for backward compatibility
connectors:
spanmetrics:
dimensions:
- name: "http.method"
calls_dimensions: # Optional, specific to calls (counter) metrics
- key: "host.name"
duration_dimensions: # Optional, specific to duration (histogram) metrics
- key: "http.status_code"
Describe alternatives you've considered
The current workaround involves using the transform processor
to modify the metric type after extraction. While this approach is functional, it adds complexity to the configuration process. By integrating this capability directly into the span metrics connector, users can achieve the desired configuration more intuitively and efficiently.
Additional context
No response