Fix TelemetryMetricsPrometheus distribution buckets configuration
- Move buckets configuration from individual metrics to reporter level - Configure default buckets for all distribution metrics in reporter options - Remove buckets from individual metric definitions to prevent ArgumentError - This fixes the pod crash due to "missing required buckets property" error The TelemetryMetricsPrometheus library requires buckets to be configured at the reporter level rather than per-metric for distribution types. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5f783894a4
commit
9b1fd942c6
1 changed files with 40 additions and 29 deletions
|
|
@ -26,7 +26,32 @@ defmodule AprsmeWeb.Telemetry do
|
||||||
{:telemetry_poller, measurements: periodic_measurements(), period: 10_000},
|
{:telemetry_poller, measurements: periodic_measurements(), period: 10_000},
|
||||||
# Add reporters as children of your supervision tree.
|
# Add reporters as children of your supervision tree.
|
||||||
# {Telemetry.Metrics.ConsoleReporter, metrics: metrics()}
|
# {Telemetry.Metrics.ConsoleReporter, metrics: metrics()}
|
||||||
{TelemetryMetricsPrometheus, [metrics: metrics()]}
|
{TelemetryMetricsPrometheus,
|
||||||
|
[
|
||||||
|
metrics: metrics(),
|
||||||
|
# Default buckets for distribution metrics
|
||||||
|
buckets: [
|
||||||
|
0.01,
|
||||||
|
0.025,
|
||||||
|
0.05,
|
||||||
|
0.1,
|
||||||
|
0.25,
|
||||||
|
0.5,
|
||||||
|
1,
|
||||||
|
2.5,
|
||||||
|
5,
|
||||||
|
10,
|
||||||
|
25,
|
||||||
|
50,
|
||||||
|
100,
|
||||||
|
250,
|
||||||
|
500,
|
||||||
|
1000,
|
||||||
|
2500,
|
||||||
|
5000,
|
||||||
|
10_000
|
||||||
|
]
|
||||||
|
]}
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -37,67 +62,54 @@ defmodule AprsmeWeb.Telemetry do
|
||||||
[
|
[
|
||||||
# Phoenix Metrics - Use distribution for latency measurements
|
# Phoenix Metrics - Use distribution for latency measurements
|
||||||
distribution("phoenix.endpoint.start.system_time",
|
distribution("phoenix.endpoint.start.system_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("phoenix.endpoint.stop.duration",
|
distribution("phoenix.endpoint.stop.duration",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("phoenix.router_dispatch.start.system_time",
|
distribution("phoenix.router_dispatch.start.system_time",
|
||||||
tags: [:route],
|
tags: [:route],
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("phoenix.router_dispatch.exception.duration",
|
distribution("phoenix.router_dispatch.exception.duration",
|
||||||
tags: [:route],
|
tags: [:route],
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("phoenix.router_dispatch.stop.duration",
|
distribution("phoenix.router_dispatch.stop.duration",
|
||||||
tags: [:route],
|
tags: [:route],
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("phoenix.socket_connected.duration",
|
distribution("phoenix.socket_connected.duration",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("phoenix.channel_join.duration",
|
distribution("phoenix.channel_join.duration",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("phoenix.channel_handled_in.duration",
|
distribution("phoenix.channel_handled_in.duration",
|
||||||
tags: [:event],
|
tags: [:event],
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond}
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
|
|
||||||
# Database Metrics - Use distribution for query times
|
# Database Metrics - Use distribution for query times
|
||||||
distribution("aprsme.repo.query.total_time",
|
distribution("aprsme.repo.query.total_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The sum of the other measurements",
|
description: "The sum of the other measurements"
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("aprsme.repo.query.decode_time",
|
distribution("aprsme.repo.query.decode_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The time spent decoding the data received from the database",
|
description: "The time spent decoding the data received from the database"
|
||||||
buckets: [1, 5, 10, 25, 50, 100, 250, 500, 1000]
|
|
||||||
),
|
),
|
||||||
distribution("aprsme.repo.query.query_time",
|
distribution("aprsme.repo.query.query_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The time spent executing the query",
|
description: "The time spent executing the query"
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
distribution("aprsme.repo.query.queue_time",
|
distribution("aprsme.repo.query.queue_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The time spent waiting for a database connection",
|
description: "The time spent waiting for a database connection"
|
||||||
buckets: [1, 5, 10, 25, 50, 100, 250, 500, 1000]
|
|
||||||
),
|
),
|
||||||
distribution("aprsme.repo.query.idle_time",
|
distribution("aprsme.repo.query.idle_time",
|
||||||
unit: {:native, :millisecond},
|
unit: {:native, :millisecond},
|
||||||
description: "The time the connection spent waiting before being checked out for the query",
|
description: "The time the connection spent waiting before being checked out for the query"
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
|
|
||||||
# VM Metrics - Use last_value for current state
|
# VM Metrics - Use last_value for current state
|
||||||
|
|
@ -115,8 +127,7 @@ defmodule AprsmeWeb.Telemetry do
|
||||||
counter("aprsme.packet_pipeline.batch.error", unit: :event, description: "Total number of errors"),
|
counter("aprsme.packet_pipeline.batch.error", unit: :event, description: "Total number of errors"),
|
||||||
distribution("aprsme.packet_pipeline.batch.duration_ms",
|
distribution("aprsme.packet_pipeline.batch.duration_ms",
|
||||||
unit: :millisecond,
|
unit: :millisecond,
|
||||||
description: "Batch insert duration (ms)",
|
description: "Batch insert duration (ms)"
|
||||||
buckets: [10, 50, 100, 250, 500, 1000, 2500, 5000, 10_000]
|
|
||||||
),
|
),
|
||||||
|
|
||||||
# Note: SystemMonitor and InsertOptimizer metrics removed after reverting performance optimizations
|
# Note: SystemMonitor and InsertOptimizer metrics removed after reverting performance optimizations
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue