-
Notifications
You must be signed in to change notification settings - Fork 272
Open
Description
As a follow-up to #1662 (comment):
Please add some debug output for the metrics exporter. Working with logs, if I set
OpenTelemetry.logger.level = Logger::DEBUG
Then I get
D, [2025-08-09T07:27:50.918650 #25729] DEBUG -- : Successfully exported 1 log records
But for metrics there is no output.
Let's add some information about successful export to Metrics. I think the Periodic Metric Reader's export
method may be a good place to start:
opentelemetry-ruby/metrics_sdk/lib/opentelemetry/sdk/metrics/export/periodic_metric_reader.rb
Lines 117 to 128 in bd01ee9
# Helper function for the defined exporter to export metrics. | |
# It only exports if the collected metrics are not an empty array (collect returns an Array). | |
# | |
# @param [optional Numeric] timeout An optional timeout in seconds. | |
# @return [Integer] SUCCESS if no error occurred, FAILURE if a | |
# non-specific failure occurred | |
def export(timeout: nil) | |
@export_mutex.synchronize do | |
collected_metrics = collect | |
@exporter.export(collected_metrics, timeout: timeout || @export_timeout) unless collected_metrics.empty? | |
end | |
end |
Metadata
Metadata
Assignees
Type
Projects
Status
To do