-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[connector/count] Break down counts by custom dimensions #19369
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This makes sense to me to an extent, but it's important that we keep in mind the extent to which data is already being dimensioned. Specifically, counts are already separated based on resource and scope. Therefore, some of the examples you've provided would not require any additional code.
We are not automatically dimensioning by lower level attributes (specifically span, span event, data point, and log record attributes), so it make sense to me that we could support these. What I am wondering is if we need to support anything other than attributes. Here's how I'm imagining the config - does this look right to you? count:
spans:
my.span.count:
conditions:
- 'resource.attributes["environment"] != nil'
attributes: # span attributes to use as dimensions
- environment
spanevents:
my.spanevent.count:
conditions:
- 'resource.attributes["environment"] != nil'
attributes: # span event attributes to use as dimensions
- environment
logs:
my.log.count:
conditions:
- 'resource.attributes["environment"] != nil'
attributes: # log record attributes to use as dimensions
- environment
datapoints:
my.datapoint.count:
conditions:
- 'resource.attributes["environment"] != nil'
attributes: # data point attributes to use as dimensions
- environment
# metrics do not have attributes
metrics:
my.metric.count: |
What is the behavior when an attribute that we are counting by does not exist? I can think of two options:
|
My default thought around this is to emit the count without that dimension. |
In my mind, it's only whatever is accessible in attributes. Can't think of a use case of anything otherwise. Your proposed configuration structure looks fine to me. |
I'm not sure this is in the spirit of our metrics data model. As I understand it, a data point should represent a "total" value, except where dimensions are specified. If we are emitting a count that omits an attribute, this implies that it is the total count observed regardless of the attribute value. There is more conversation about this here. Although the spec issue is not resolved, it seems to me there is consensus that a single emitter of telemetry should not emit metrics with multiple sets of attributes.
|
Having thought about this more, I think the correct behavior is neither of these options. I suggest that we should provide an optional setting in the attributes configuration: logs:
my.log.count:
conditions:
- 'resource.attributes["environment"] != nil'
attributes:
- key: environment
default: other # logs observed that did not contain the "environment" attribute If the It could be argued that logs:
my.log.count:
conditions:
- 'resource.attributes["environment"] != nil'
attributes:
- environment
my.log.missing_environment:
conditions:
- 'resource.attributes["environment"] == nil' |
I'm going to assign this to myself and will try to have a PR soon. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This is still relevant to me. I've been on leave and haven't keep up-to-date regarding development to this feature but I can see some changes in code. I'll try to find time to explore this again for myself. |
I believe this is effectively resolved by #19432. @hannahchan, thanks for taking an interest in this. Please let me know if you still need additional enhancements. |
Component(s)
connector/count
Is your feature request related to a problem? Please describe.
The current implementation of the
count
connector doesn't allow us to breakdown a count metric by our own custom dimensions. Breaking down the count metrics will allow us to understand more about our telemetry.I want to b able to specify a dimension such as an resource attribute named
environment
and then havecount
connector break out thetrace.span.count
for example by the values of theenvironment
resource attribute. Below is an example of the time series I expect to be generated for example when I do this.Some custom dimensions we want to specify include;
We would also like to see byte counts for logs, metrics and traces broken down by these dimensions.
Describe the solution you'd like
I would like to be able to specify the custom dimensions for the
count
connector in my collector's config and then have thecount
connector breakdown the counts according to my specified dimensions. I would also like to be able to enabled byte count metrics in my configuration as well.Describe alternatives you've considered
We've considered building a
processor
that does this and emit the metrics to the collector's/metrics
endpoint. Because you can order processors and have multiple of the same process in a pipeline, you can count the logs, metrics and traces at different stages of a pipeline.Additional context
We have an established multi-region SaaS application that we are uplifting to use OpenTelemetry automatic instrumentation.
We know from experimentation in a test environment that the automatic instrumentation emits more telemetry than our previous instrumentation. However this doesn't help us estimate or understand the volume of telemetry that our application will emit in production upfront without incurring the full cost of transporting and storing that telemetry.
Our current thinking is to deploy and configure the OpenTelemetry collector in our production environment as a measuring device that can count the logs, metrics and traces that our application will emit and then discards that telemetry or pass it through to the next process.
The text was updated successfully, but these errors were encountered: