@opentelemetry/exporter-prometheus
Advanced tools
Comparing version 0.16.1-alpha.18 to 0.16.1-alpha.19
@@ -23,2 +23,6 @@ import * as api from '@opentelemetry/api'; | ||
/** | ||
* @default undefined (all interfaces) | ||
*/ | ||
host?: string; | ||
/** | ||
* Port number for Prometheus exporter server | ||
@@ -25,0 +29,0 @@ * |
@@ -8,2 +8,3 @@ /// <reference types="node" /> | ||
static readonly DEFAULT_OPTIONS: { | ||
host: undefined; | ||
port: number; | ||
@@ -15,2 +16,3 @@ endpoint: string; | ||
private readonly _logger; | ||
private readonly _host?; | ||
private readonly _port; | ||
@@ -17,0 +19,0 @@ private readonly _endpoint; |
@@ -71,3 +71,10 @@ "use strict"; | ||
this._logger = config.logger || new api.NoopLogger(); | ||
this._port = config.port || PrometheusExporter.DEFAULT_OPTIONS.port; | ||
this._host = | ||
config.host || | ||
process.env.OTEL_EXPORTER_PROMETHEUS_HOST || | ||
PrometheusExporter.DEFAULT_OPTIONS.host; | ||
this._port = | ||
config.port || | ||
Number(process.env.OTEL_EXPORTER_PROMETHEUS_PORT) || | ||
PrometheusExporter.DEFAULT_OPTIONS.port; | ||
this._prefix = config.prefix || PrometheusExporter.DEFAULT_OPTIONS.prefix; | ||
@@ -82,3 +89,5 @@ this._appendTimestamp = | ||
if (config.preventServerStart !== true) { | ||
this.startServer().then(callback); | ||
this.startServer() | ||
.then(callback) | ||
.catch(err => this._logger.error(err)); | ||
} | ||
@@ -151,4 +160,7 @@ else if (callback) { | ||
return new Promise(resolve => { | ||
this._server.listen(this._port, () => { | ||
this._logger.debug(`Prometheus exporter started on port ${this._port} at endpoint ${this._endpoint}`); | ||
this._server.listen({ | ||
port: this._port, | ||
host: this._host, | ||
}, () => { | ||
this._logger.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`); | ||
resolve(); | ||
@@ -169,2 +181,3 @@ }); | ||
PrometheusExporter.DEFAULT_OPTIONS = { | ||
host: undefined, | ||
port: 9464, | ||
@@ -171,0 +184,0 @@ endpoint: '/metrics', |
{ | ||
"name": "@opentelemetry/exporter-prometheus", | ||
"version": "0.16.1-alpha.18+9f965b0c", | ||
"version": "0.16.1-alpha.19+03e741bc", | ||
"description": "OpenTelemetry Exporter Prometheus provides a metrics endpoint for Prometheus", | ||
@@ -58,6 +58,6 @@ "main": "build/src/index.js", | ||
"@opentelemetry/api-metrics": "^0.16.0", | ||
"@opentelemetry/core": "^0.16.1-alpha.18+9f965b0c", | ||
"@opentelemetry/metrics": "^0.16.1-alpha.18+9f965b0c" | ||
"@opentelemetry/core": "^0.16.0", | ||
"@opentelemetry/metrics": "^0.16.0" | ||
}, | ||
"gitHead": "9f965b0c749108df00bbe44eeab84d79b04bb0a4" | ||
"gitHead": "03e741bc8404d44e899bbb80baa75bc321e4630a" | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances 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
51494
625
3
+ Added@opentelemetry/core@0.16.0(transitive)
+ Added@opentelemetry/metrics@0.16.0(transitive)
+ Added@opentelemetry/resources@0.16.0(transitive)
- Removed@opentelemetry/api@0.16.1-alpha.20(transitive)
- Removed@opentelemetry/api-metrics@0.16.1-alpha.20(transitive)
- Removed@opentelemetry/core@0.16.1-alpha.20(transitive)
- Removed@opentelemetry/metrics@0.16.1-alpha.20(transitive)
- Removed@opentelemetry/resources@0.16.1-alpha.20(transitive)
Updated@opentelemetry/core@^0.16.0