Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

log_to_metric does not support aggregated_histogram metrics output by vector itself #20494

Open
oivindoh opened this issue May 14, 2024 · 0 comments
Labels
transform: log_to_metric Anything `log_to_metric` transform related type: bug A code related bug.

Comments

@oivindoh
Copy link

A note for the community

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

Vector's internal metrics emits metrics with the "aggregated_histogram" type. As part of my pipeline I convert these metrics to logs to be able to ship them to a remote http_server vector source.

This might not be the optimal setup when one could use a native vector source instead, but it has uncovered that log_to_metric emits an ERROR when it encounters logs with the aggregated_histogram聽property, as discussed here.

Relevant log

2024-05-14T10:45:01.277458Z ERROR transform{component_kind="transform" component_id=logs_to_metrics component_type=log_to_metric}: vector::internal_events::log_to_metric: Internal log [Missing required metric details. Required one of gauge, distribution, histogram, summary, counter] has been suppressed 279 times.
2024-05-14T10:45:01.277528Z ERROR transform{component_kind="transform" component_id=logs_to_metrics component_type=log_to_metric}: vector::internal_events::log_to_metric: Missing required metric details. Required one of gauge, distribution, histogram, summary, counter error_code="missing_metric_details" error_type="parser_failed" stage="processing" internal_log_rate_limit=true
2024-05-14T10:45:01.277585Z ERROR transform{component_kind="transform" component_id=logs_to_metrics component_type=log_to_metric}: vector_common::internal_event::component_events_dropped: Internal log [Events dropped] has been suppressed 279 times.
2024-05-14T10:45:01.278201Z ERROR transform{component_kind="transform" component_id=logs_to_metrics component_type=log_to_metric}: vector_common::internal_event::component_events_dropped: Events dropped intentional=false count=1 reason="Missing required metric details. Required one of gauge, distribution, histogram, summary, counter" internal_log_rate_limit=true
2024-05-14T10:45:01.278310Z ERROR transform{component_kind="transform" component_id=logs_to_metrics component_type=log_to_metric}: vector::internal_events::log_to_metric: Internal log [Missing required metric details. Required one of gauge, distribution, histogram, summary, counter] is being suppressed to avoid flooding.
2024-05-14T10:45:01.278348Z ERROR transform{component_kind="transform" component_id=logs_to_metrics component_type=log_to_metric}: vector_common::internal_event::component_events_dropped: Internal log [Events dropped] is being suppressed to avoid flooding.

Currently I work around this problem simply by using a route transform that matchese these events, and then using log_to_metric on that route's _unmatched route.

Configuration

sources:
  logs_only_receiver:
    type: http_server
    address: 0.0.0.0:8081
    decoding:
      codec: json

  vector_metrics:
    type: internal_metrics

transforms:
  metrics_to_logs:
    type: metric_to_log
    inputs: [ vector_metrics ]

  # Drop aggregated histogram events because log_to_metric does not support it as of 0.38.1
  drop_route:
    type: route
    route:
      aggregated_histogram: .aggregated_histogram != null
    inputs:
      - logs_only_receiver

  logs_to_metrics:
    type: log_to_metric
    metrics: []
    all_metrics: true
    inputs:
      - drop_route._unmatched
  
sinks:
  send_to_http_server:
    type: http
    inputs:
      - metrics_to_logs
    uri: http://localhost:8081
    encoding:
      codec: json

  export_received_metrics:
    type: prometheus_exporter
    address: 0.0.0.0:9199
    inputs: [ logs_to_metrics ]

Version

0.38.1

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

@oivindoh oivindoh added the type: bug A code related bug. label May 14, 2024
@oivindoh oivindoh changed the title log_to_metric does not support aggregated_histogram metrics log_to_metric does not support aggregated_histogram metrics output by vector itself May 14, 2024
@jszwedko jszwedko added the transform: log_to_metric Anything `log_to_metric` transform related label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
transform: log_to_metric Anything `log_to_metric` transform related type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

2 participants