📦 MetricsData represents the metrics data that can be stored or transferred.

This is the top-level container for all metric data in OpenTelemetry. It organizes metrics by resource and instrumentation scope for efficient processing and analysis.

const metricsData: MetricsData = {
resourceMetrics: [
{
resource: {
attributes: [
{ key: "service.name", value: { stringValue: "turtle-fleet" } },
{ key: "turtle.id", value: { intValue: 42 } }
],
droppedAttributesCount: 0
},
scopeMetrics: [
{
scope: {
name: "mining-operations",
version: "1.0.0",
attributes: [],
droppedAttributesCount: 0
},
metrics: [
// ... metric definitions
],
schemaUrl: ""
}
],
schemaUrl: ""
}
]
};
interface MetricsData {
    resourceMetrics: ResourceMetrics[];
}

Properties

Properties

resourceMetrics: ResourceMetrics[]

Array of resource metrics, each containing metrics from a specific resource