@opentelemetry/exporter-prometheus
Advanced tools
Comparing version 0.19.1-alpha.37 to 0.19.1-alpha.38
@@ -52,2 +52,18 @@ "use strict"; | ||
} | ||
/** | ||
* @private | ||
* | ||
* Helper method which assists in enforcing the naming conventions for metric | ||
* names in Prometheus | ||
* @param name the name of the metric | ||
* @param kind the kind of metric | ||
* @returns string | ||
*/ | ||
function enforcePrometheusNamingConvention(name, kind) { | ||
// Prometheus requires that metrics of the Counter kind have "_total" suffix | ||
if (!name.endsWith('_total') && kind === metrics_1.MetricKind.COUNTER) { | ||
name = name + '_total'; | ||
} | ||
return name; | ||
} | ||
function valueString(value) { | ||
@@ -125,2 +141,3 @@ if (Number.isNaN(value)) { | ||
} | ||
name = enforcePrometheusNamingConvention(name, checkpoint.descriptor.metricKind); | ||
const help = `# HELP ${name} ${escapeString(checkpoint.descriptor.description || 'description missing')}`; | ||
@@ -135,2 +152,3 @@ const type = `# TYPE ${name} ${toPrometheusType(checkpoint.descriptor.metricKind, checkpoint.aggregatorKind)}`; | ||
let results = ''; | ||
name = enforcePrometheusNamingConvention(name, record.descriptor.metricKind); | ||
switch (record.aggregator.kind) { | ||
@@ -137,0 +155,0 @@ case metrics_1.AggregatorKind.SUM: |
{ | ||
"name": "@opentelemetry/exporter-prometheus", | ||
"version": "0.19.1-alpha.37+a0385c45", | ||
"version": "0.19.1-alpha.38+7775c0e2", | ||
"description": "OpenTelemetry Exporter Prometheus provides a metrics endpoint for Prometheus", | ||
@@ -60,7 +60,7 @@ "main": "build/src/index.js", | ||
"dependencies": { | ||
"@opentelemetry/api-metrics": "^0.19.1-alpha.37+a0385c45", | ||
"@opentelemetry/core": "^0.19.1-alpha.37+a0385c45", | ||
"@opentelemetry/metrics": "^0.19.1-alpha.37+a0385c45" | ||
"@opentelemetry/api-metrics": "^0.19.0", | ||
"@opentelemetry/core": "^0.19.0", | ||
"@opentelemetry/metrics": "^0.19.0" | ||
}, | ||
"gitHead": "a0385c45376a86d396cb364feda2b4afebd836d1" | ||
"gitHead": "7775c0e2ffc5a4597e8aa401a18f1bae4d644780" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
52562
640
+ Added@opentelemetry/api-metrics@0.19.0(transitive)
+ Added@opentelemetry/core@0.19.0(transitive)
+ Added@opentelemetry/metrics@0.19.0(transitive)
+ Added@opentelemetry/resources@0.19.0(transitive)
- Removed@opentelemetry/api@0.20.0(transitive)
- Removed@opentelemetry/api-metrics@0.19.1-alpha.43(transitive)
- Removed@opentelemetry/core@0.19.1-alpha.43(transitive)
- Removed@opentelemetry/metrics@0.19.1-alpha.43(transitive)
- Removed@opentelemetry/resources@0.19.1-alpha.43(transitive)
- Removed@opentelemetry/semantic-conventions@0.19.1-alpha.43(transitive)
Updated@opentelemetry/core@^0.19.0