1
0
mirror of synced 2024-12-03 18:57:19 +01:00

Export metrics over HTTP rather than gRPC because idfk that might work???

This commit is contained in:
Luna 2022-11-19 22:13:08 +00:00
parent 8c2e8b1bb0
commit 21916d266b

View File

@ -9,7 +9,7 @@ import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'
import process from 'process'; import process from 'process';
import {Request, Response, Application} from 'express'; import {Request, Response, Application} from 'express';
import { AggregationTemporality, MeterProvider, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics'; import { AggregationTemporality, MeterProvider, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-grpc'; import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
export function startTracing() { export function startTracing() {
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO); diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
@ -72,7 +72,7 @@ export function startHttpMetrics(apps: HttpMetricsParameter[]) {
} }
const exporter = new OTLPMetricExporter({ const exporter = new OTLPMetricExporter({
url: process.env.OPENTELEMETRY_OTLP_URI, url: process.env.OPENTELEMETRY_OTLP_HTTP_URI,
}); });
provider.addMetricReader(new PeriodicExportingMetricReader({ provider.addMetricReader(new PeriodicExportingMetricReader({