Skip to content

fix(log_to_metric): support aggregated_histogram and aggregated_summary keys #22860

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Apr 11, 2025

Summary

Adds support for handling aggregated_histogram and aggregated_summary keys to the log_to_metric transform, ensuring round-trip compatibility with the metric_to_log transform that serializes objects to these aggregated_-prefixed key names.

Change Type

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

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

[todo]

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.

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • The CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • cargo fmt --all
      • cargo clippy --workspace --all-targets -- -D warnings
      • cargo nextest run --workspace (alternatively, you can run cargo test --all)
      • ./scripts/check_changelog_fragments.sh
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run cargo vdev build licenses to regenerate the license inventory and commit the changes (if any). More details here.

References

…y keys

Ensures round-trip compatibility with metric_to_log transform.
Fixes vectordotdev#20494.
@wjordan wjordan requested a review from a team as a code owner April 11, 2025 20:13
@github-actions github-actions bot added the domain: transforms Anything related to Vector's transform components label Apr 11, 2025
Copy link
Member

@pront pront left a comment

Choose a reason for hiding this comment

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

Hi @wjordan, thanks for this contribution!
Can you perhaps add a test for aggregated_histogram and aggregated_summary?

.ok_or_else(|| TransformError::PathNotFound {
path: "histogram.buckets".to_string(),
path: format!("{}.buckets", key),
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
path: format!("{}.buckets", key),
path: format!("{key}.buckets"),

This should be applied to all format! calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 does not support aggregated_histogram metrics output by vector itself
2 participants