Class ClientExportableMetric
java.lang.Object
io.confluent.telemetry.emitter.ContextExportableMetric
io.confluent.telemetry.emitter.ClientExportableMetric
- All Implemented Interfaces:
ExportableMetric, Keyed
The
ClientExportableMetric class extends ContextExportableMetric to process client
metrics telemetry data. It is responsible for organizing resource-level and scope-level
attributes in a Metric/MetricsData payload and ensuring proper formatting for export.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.opentelemetry.proto.metrics.v1.Metricmetric()Returns the metric with resource attributes, brokerLabels and requestLabels added to the metric data point.io.opentelemetry.proto.metrics.v1.ResourceMetricsMethods inherited from class ContextExportableMetric
instrumentationScope, key, resource
-
Constructor Details
-
ClientExportableMetric
-
-
Method Details
-
metric
public io.opentelemetry.proto.metrics.v1.Metric metric()Returns the metric with resource attributes, brokerLabels and requestLabels added to the metric data point. The HttpExporter uses getMetric() to get the metric data point for export. A copy of the metric is created, and all relevant attributes from resource attributes, broker labels, and request labels are added to the metric's data point before export.The method first retrieves the base metric from the parent class using
super.getMetric()to get the original metric structure. This original metric is then enhanced with client-specific attributes by adding them to the metric's data point, preserving the metric's core data while adding the necessary context for client telemetry.- Specified by:
metricin interfaceExportableMetric- Overrides:
metricin classContextExportableMetric- Returns:
- A
Metricwith all resource and scope-level attributes included in its data point
-
resourceMetrics
public io.opentelemetry.proto.metrics.v1.ResourceMetrics resourceMetrics()- Specified by:
resourceMetricsin interfaceExportableMetric- Overrides:
resourceMetricsin classContextExportableMetric- Returns:
- the
ResourceMetricsassociated with this ContextExportableMetric
-