Skip to content

feat(otel-node): set metrics temporality preference to delta#670

Merged
david-luna merged 14 commits intomainfrom
dluna-metrics-temporality-delta
Mar 31, 2025
Merged

feat(otel-node): set metrics temporality preference to delta#670
david-luna merged 14 commits intomainfrom
dluna-metrics-temporality-delta

Conversation

@david-luna
Copy link
Member

Done via env var if user hasn't set any other value.

Closes: #468

@david-luna
Copy link
Member Author

Using it with local EDOT collector I'm getting some warnings

Starting in otel mode
2025-03-21T15:25:53.754+0100	info	service@v0.120.0/service.go:193	Setting up own telemetry...
2025-03-21T15:25:53.755+0100	info	builders/builders.go:26	Development component. May change in the future.	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics"}
2025-03-21T15:25:53.755+0100	info	builders/builders.go:26	Development component. May change in the future.	{"otelcol.component.id": "elasticapm", "otelcol.component.kind": "Connector", "otelcol.signal": "logs", "otelcol.signal.output": "metrics"}
2025-03-21T15:25:53.756+0100	info	lsmintervalprocessor@v0.5.1/processor.go:129	no directory specified, switching to in-memory mode	{"otelcol.component.id": "elasticapm", "otelcol.component.kind": "Connector", "otelcol.signal": "logs", "otelcol.signal.output": "metrics"}
2025-03-21T15:25:53.756+0100	info	builders/builders.go:26	Development component. May change in the future.	{"otelcol.component.id": "elasticapm", "otelcol.component.kind": "Connector", "otelcol.signal": "traces", "otelcol.signal.output": "metrics"}
2025-03-21T15:25:53.757+0100	info	service@v0.120.0/service.go:258	Starting ./elastic-agent...	{"Version": "9.0.0-rc1", "NumCPU": 12}
2025-03-21T15:25:53.757+0100	info	extensions/extensions.go:40	Starting extensions...
2025-03-21T15:25:53.759+0100	info	otlpreceiver@v0.120.0/otlp.go:116	Starting GRPC server	{"otelcol.component.id": "otlp/fromsdk", "otelcol.component.kind": "Receiver", "endpoint": "localhost:4317"}
2025-03-21T15:25:53.760+0100	info	otlpreceiver@v0.120.0/otlp.go:173	Starting HTTP server	{"otelcol.component.id": "otlp/fromsdk", "otelcol.component.kind": "Receiver", "endpoint": "localhost:4318"}
2025-03-21T15:25:53.761+0100	info	service@v0.120.0/service.go:281	Everything is ready. Begin running and processing data.
2025-03-21T15:26:56.591+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:27:56.487+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:28:56.492+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:29:56.500+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:30:56.510+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:31:56.500+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:32:56.498+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:33:56.475+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:34:56.505+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:35:56.498+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:36:56.494+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:37:56.489+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:38:56.495+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:39:56.516+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:40:56.572+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""}
2025-03-21T15:41:56.516+0100	warn	elasticsearchexporter@v0.120.1/exporter.go:384	validation errors	{"otelcol.component.id": "elasticsearch/otel", "otelcol.component.kind": "Exporter", "otelcol.signal": "metrics", "error": "dropping cumulative temporality histogram \"http.server.duration\"\ndropping cumulative temporality histogram \"http.client.duration\"\ndropping cumulative temporality histogram \"v8js.gc.duration\""} 
@david-luna
Copy link
Member Author

I was setting the default value too late and did not get applied when creating the metrics exporters. Added some tests to check the temporality is correct in the metrics sent

@david-luna david-luna marked this pull request as ready for review March 28, 2025 09:31
@david-luna david-luna requested a review from trentm March 28, 2025 09:31
'delta';
} else if (temporalityPreference !== 'delta') {
log.warn(
`Metrics temporality preference is set to "${temporalityPreference}". Use "delta" for proper analysis of histogram metrics in Kibana`
Copy link
Member

Choose a reason for hiding this comment

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

Do you happen to know if the other lang SDKs are warning on this?

Copy link
Member Author

@david-luna david-luna Mar 31, 2025

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we remove it then and rely on the docs then?

I guess is better to have it clearly written in the docs.

david-luna and others added 5 commits March 31, 2025 08:00
…MPORALITY_PREFERENCE.test.js

Co-authored-by: Trent Mick <trent.mick@elastic.co>
…ics.js

Co-authored-by: Trent Mick <trent.mick@elastic.co>
…ics.js

Co-authored-by: Trent Mick <trent.mick@elastic.co>
…elastic-otel-node into dluna-metrics-temporality-delta
@david-luna david-luna merged commit 786a501 into main Mar 31, 2025
9 checks passed
@david-luna david-luna deleted the dluna-metrics-temporality-delta branch March 31, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants