Skip to content

Comments

fix(log_to_metric transform): Use correct keys for histogram/summary#24394

Merged
thomasqueirozb merged 4 commits intovectordotdev:masterfrom
jblazquez:master
Jan 28, 2026
Merged

fix(log_to_metric transform): Use correct keys for histogram/summary#24394
thomasqueirozb merged 4 commits intovectordotdev:masterfrom
jblazquez:master

Conversation

@jblazquez
Copy link
Contributor

@jblazquez jblazquez commented Dec 17, 2025

Summary

This PR fixes log_to_metric transform to correctly handle metrics with a value type of MetricValue::AggregatedHistogram or MetricValue::AggregatedSummary.

See #24393

Vector configuration

[sources.opentelemetry]
type = "opentelemetry"
grpc.address = "0.0.0.0:4317"
http.address = "0.0.0.0:4318"

[transforms.my_metric_to_log]
type = "metric_to_log"
inputs = ["opentelemetry.metrics"]

[transforms.my_log_to_metric]
type = "log_to_metric"
inputs = [ "my_metric_to_log" ]
all_metrics = true
metrics = []

How did you test this PR?

  1. Set up a graph as shown above.
  2. Posted an OTEL Summary metric.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

@jblazquez jblazquez requested a review from a team as a code owner December 17, 2025 21:57
@github-actions github-actions bot added the domain: transforms Anything related to Vector's transform components label Dec 17, 2025
@jblazquez
Copy link
Contributor Author

jblazquez commented Jan 6, 2026

@pront Sorry for the direct ping, but this PR has been open for 3 weeks and you were the last one to modify this file, so I was hoping someone could take a look. Thanks!

Copy link
Member

@bruceg bruceg left a comment

Choose a reason for hiding this comment

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

I've searched the commit history for this transform, and it has always used these names, so this fix looks correct to me. It would be ideal to have a combined metric_to_log => log_to_metric test, preferably using proptest, to fully validate this, but that may be a little beyond the scope of this PR.

@jblazquez
Copy link
Contributor Author

Thanks Bruce. I did look into what would be involved in writing an end-to-end test but I didn't see any existing examples of that for this area of the code and felt it would increase the scope of the work quite a bit to figure that out.

Copy link
Contributor

@thomasqueirozb thomasqueirozb left a comment

Choose a reason for hiding this comment

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

Thanks!

@thomasqueirozb thomasqueirozb added this pull request to the merge queue Jan 28, 2026
Merged via the queue into vectordotdev:master with commit 2da8b24 Jan 28, 2026
50 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: transforms Anything related to Vector's transform components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

log_to_metric: Histogram and summary metrics are converted incorrectly

3 participants