Skip to content

Conversation

@lahsivjar
Copy link
Contributor

@lahsivjar lahsivjar commented Jul 3, 2024

system.process.* fields are required on the process metrics to make the UI work. These are non-ecs fields but must haves for the Processes tab in the Host metrics UI to work.

All these fields are processed as data point attributes added to the remapped OTel metrics due to UI constraints (explained in code comments).

Related to:

To be merged after elastic/opentelemetry-lib#35

@lahsivjar lahsivjar requested a review from a team as a code owner July 3, 2024 10:58
@obltmachine obltmachine added the safe-to-test Changes are safe to run in the CI label Jul 3, 2024
@lahsivjar lahsivjar requested a review from axw July 3, 2024 10:58
@lahsivjar lahsivjar changed the title Handle system.process.state in OTel translated metrics Handle system.process.* for OTel translated metrics Jul 3, 2024
Comment on lines +207 to +213
// `system.process.cmdline` is same as the ECS field `process.command_line`
// however, Kibana curated UIs requires this field to work. In addition,
// the current Kibana code will not work if this field is added to documents
// with `system.process.memory.rss.pct` and other metrics required in the
// Processes tab of the Kibana hostmetrics UI. Due to this, we have to process
// the datapoint field added by the opentelemetry-lib instead of directly
// processing the OTel semconv resource attribute `process.command_line`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felixbarny @axw This means that we would not be able to remove the attributes added at https://github.com/elastic/opentelemetry-lib/blob/54a9569b27e3f11edc0d660dc79ac865256f3cd3/remappers/hostmetrics/process.go#L271-L295 and rely on the translations performed in APM/esexporter without UI fixing such hard dependencies. One such case I have explained here (elastic only link).

axw
axw previously approved these changes Jul 4, 2024
@lahsivjar lahsivjar requested a review from kruskall July 4, 2024 09:08
@carsonip carsonip self-requested a review July 4, 2024 11:16
carsonip
carsonip previously approved these changes Jul 4, 2024
Name: "app",
Samples: []*modelpb.MetricsetSample{
{
Name: "system.load.5",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why is this here in the first place with no value, and why is it not present now after the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is due to how otel lib behaves. There was a fix in v0.6.0 but that had to reverted in v0.6.1 so these lines need to be added back. I have added a comment explaining why it is there pasting below for reference:

				// TODO (lahsivjar): Opentelemetry lib currently adds all metrics, even
				// though the source metrics is not present. Due to this all the metrics
				// need to be asserted making the tests brittle. This should be fixed by
				// https://github.com/elastic/opentelemetry-lib/issues/6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe-to-test Changes are safe to run in the CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants