-
Notifications
You must be signed in to change notification settings - Fork 894
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
Add namespace for process metric attributes #3431
Conversation
([#3390](https://github.com/open-telemetry/opentelemetry-specification/pull/3390)) | ||
- Rename `process.cpu.time` metric attribute `state` to `cpu.state`, | ||
rename `process.cpu.utilization` metric attribute `state` to `cpu.state`, | ||
rename `process.disk.io` metric attribute `direction` to `disk.direction`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not targeting this PR, I'll restate that disk direction is very weird, most operating systems model disks with read/write/control.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand wanting the consistency. I, personally, view disk as "yet another type of network operation", thanks to years of SAN and DFS.
I think we SHOULD get together a semconv group to really look at these at some point, but unfortunately we have a ton of users right now.
Simple renames and namespacing, I think we can afford to do, especially given what this could provide us w/ Log -> Metric or Trace -> Metric generation.
Anything more semantically different, we need to be cautious about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm supportive of this direction and I think the spirit is also well aligned with https://github.com/open-telemetry/oteps/blob/6b62348b280b82036e897781d49ac4f2c3a9d95e/text/0199-support-elastic-common-schema-in-opentelemetry.md.
Not a blocker for now - I think many of these attributes will be useful for other areas (e.g. for a different metrics stream, for logs and traces) so eventually they should be extracted to a common place.
@AlexanderWert I want to get your input regarding metrics attributes (dimensions). |
This breaks hostmetrics receiver in the Collector, which is declared Beta and is likely one of the most used receivers in the Collector. FYI, @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers What is the justification for this change?
It does. You can use |
being able to share the same attributes across traces, metrics and logs see @jsuereth's #3342 (review):
|
Good point. I think we need to put some more thought into this this. The purpose of namespacing is to avoid name conflicts. Attributes that we define for only a particular metric are already in their own namespace, the name of the metric (e.g. Generic attributes (e.g. I think we need to make it a rule that metric-only attributes defined for specific metrics don't need to be in a namespace. So, I would make this change only for attributes which we plan to also record for traces and logs or which are defined as general-purpose attributes which can be recorded on any metrics (and thus have higher probability of clashes with other such attributes). At a glance @jsuereth thoughts? |
This seems like an appealing way to think about it. I wonder how this would work with code generation. Right now code generation produces one big class containing all the attributes for traces, metrics, and logs. If an attribute like cpu Something like:
Or:
|
I agree that lots of metric attributes don't have a use on spans, but it seems like they could potentially be useful on logs, e.g.
|
nice, I added this, thx |
From the metrics attributes mentioned above, the only one I see a valuable correlation between metrics and logs is However, if we want to align this with ECS' In OTel In ECS the valid values for
With the following description:
Alternatively, we could think about adding |
([#3390](https://github.com/open-telemetry/opentelemetry-specification/pull/3390)) | ||
- Rename `process.cpu.time` metric attribute `state` to `cpu.state`, | ||
rename `process.cpu.utilization` metric attribute `state` to `cpu.state`, | ||
rename `process.disk.io` metric attribute `direction` to `disk.direction`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand wanting the consistency. I, personally, view disk as "yet another type of network operation", thanks to years of SAN and DFS.
I think we SHOULD get together a semconv group to really look at these at some point, but unfortunately we have a ton of users right now.
Simple renames and namespacing, I think we can afford to do, especially given what this could provide us w/ Log -> Metric or Trace -> Metric generation.
Anything more semantically different, we need to be cautious about.
TBH I don't like these changes. As @tigrannajaryan mentioned, there is no possible conflict between attributes using the same name but for different metrics. Specifying Also, metrics don't have the same hierarchical nature as logs and traces with inherited attributes and context. This justifies having different rules for metrics attributes. Now, I hear the argument about correlation between spans, logs, and metrics. The goal is noble but adding too much constraints on attributes naming between traces and metrics is going to create a lot of discussion and tension between spec writers. There are cases where a span attribute will require a very long namespace, and a small rare use case where we may want to correlate that attribute with a metric, and then the metric should use the long namespace for the attribute name, causing migration issues, etc. While consistency is absolutely necessary, correlation between metrics and traces cannot be ensured by semantic conventions. Correlation engines will always require some mapping mechanisms, and in the age of AIOps, enforcing identical attribute names everywhere doesn't sound necessary. Sorry for the long rant, I just mean: can't we keep it as simple as possible, while ensuring consistency in terms, and rely on implementation for correlation and other niceties? |
@trask heads up - most likely this PR will be closed, and we'll ask you to resubmit the PR in a new repo, please refer to #3474 (comment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to indicate my support, even though I understand this PR will need to be re-opened against the new repo.
My reasons:
- Its very convenient to have a global set of attribute keys which mean the same thing in all contexts. This isn't strictly necessary, since we can say metric attributes are scoped to the metric name, but its a nicety I'm reluctant to give up.
- It will be hard to anticipate when an attribute will only be used in a metric (and not need a namespace) vs be used across signals (and need a namespace). Telemetry schemas would allow for renames if an attribute is initially limited to metrics and later is exposed in logs or traces, but IMO its better to not have to use telemetry schemas even if they could be used.
- Common rules for attributes in all signals is simpler than having an exception just for metrics. I don't share the view that using non-namespaced attributes for metrics is simpler. Consistency is simplicity.
Since there are good arguments for namespacing metric attributes as well as against, how about adding this requirement: For each metric, its attribute names must be unique even after stripping the namespacing prefix. This will allow some flexibility with handling metric attributes by backends, and specifically UIs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
hey all, the https://github.com/orgs/open-telemetry/teams/technical-committee is reviewing this issue, and asked to create a summary of pros/cons. I have created open-telemetry/semantic-conventions#51 based on the comments here, please comment further over there if I missed anything, thx! |
Part of #3131
Note: I'm not sure what the best approach is here, so took a stab at it to see what this would look like.
(also note that my ulterior motive for pushing this forward is because we have similar questions in JVM runtime metrics, and so want to get community alignment on this issue)
Changes
Adds namespace for process metric attributes:
process.cpu.time
andprocess.cpu.utilization
metricsstate
renamed tocpu.state
process.disk.io
metricdirection
renamed todisk.direction
process.network.io
metricdirection
renamed tonetwork.direction
process.context_switches
type
renamed tocontext_switch.type
process.paging.faults
(should we consider renaming toprocess.memory.page_faults
?)type
renamed tomemory.page_fault.type
(I don't think schema transformations support this, since e.g. we don't want to rename the metric attributestate
across all metrics, only the one for theprocess.cpu.time
metric)Summary of benefits
Metrics can be derived from logs.
raw measurements can be emitted via logs.