File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
packages/node-opentelemetry/src Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @hyperdx/node-opentelemetry ' : patch
3+ ---
4+
5+ feat: support OTEL_METRIC_EXPORT_INTERVAL and OTEL_METRIC_EXPORT_TIMEOUT
Original file line number Diff line number Diff line change @@ -36,13 +36,19 @@ export const DEFAULT_OTEL_LOGS_EXPORTER_URL =
3636 ( otelEnv . OTEL_EXPORTER_OTLP_ENDPOINT
3737 ? `${ otelEnv . OTEL_EXPORTER_OTLP_ENDPOINT } /v1/logs`
3838 : 'https://in-otel.hyperdx.io/v1/logs' ) ;
39- export const DEFAULT_OTEL_METRICS_EXPORTER = ( otelEnv as any )
40- . OTEL_METRICS_EXPORTER ; // not exist yet
39+ export const DEFAULT_OTEL_METRICS_EXPORTER = env . OTEL_METRICS_EXPORTER ; // not exist yet
4140export const DEFAULT_OTEL_METRICS_EXPORTER_URL =
4241 otelEnv . OTEL_EXPORTER_OTLP_METRICS_ENDPOINT ??
4342 ( otelEnv . OTEL_EXPORTER_OTLP_ENDPOINT
4443 ? `${ otelEnv . OTEL_EXPORTER_OTLP_ENDPOINT } /v1/metrics`
4544 : 'https://in-otel.hyperdx.io/v1/metrics' ) ;
45+ export const DEFAULT_OTEL_METRIC_EXPORT_INTERVAL =
46+ env . OTEL_METRIC_EXPORT_INTERVAL
47+ ? Number ( env . OTEL_METRIC_EXPORT_INTERVAL )
48+ : 60000 ; // not exist yet
49+ export const DEFAULT_OTEL_METRIC_EXPORT_TIMEOUT = env . OTEL_METRIC_EXPORT_TIMEOUT
50+ ? Number ( env . OTEL_METRIC_EXPORT_TIMEOUT )
51+ : 30000 ; // not exist yet
4652export const DEFAULT_SERVICE_NAME = ( ) =>
4753 getEnvWithoutDefaults ( ) . OTEL_SERVICE_NAME ?? defaultServiceName ( ) ;
4854export const DEFAULT_OTEL_LOG_LEVEL = otelEnvWithDefaults . OTEL_LOG_LEVEL ;
Original file line number Diff line number Diff line change 11import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-proto' ;
22import { PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics' ;
33
4- import { DEFAULT_OTEL_METRICS_EXPORTER_URL } from './constants' ;
4+ import {
5+ DEFAULT_OTEL_METRIC_EXPORT_INTERVAL ,
6+ DEFAULT_OTEL_METRIC_EXPORT_TIMEOUT ,
7+ DEFAULT_OTEL_METRICS_EXPORTER_URL ,
8+ } from './constants' ;
59
610export const getHyperDXMetricReader = ( ) =>
711 new PeriodicExportingMetricReader ( {
812 exporter : new OTLPMetricExporter ( {
913 url : DEFAULT_OTEL_METRICS_EXPORTER_URL ,
1014 } ) ,
11- exportIntervalMillis : 1000 ,
15+ exportIntervalMillis : DEFAULT_OTEL_METRIC_EXPORT_INTERVAL ,
16+ exportTimeoutMillis : DEFAULT_OTEL_METRIC_EXPORT_TIMEOUT ,
1217 } ) ;
You can’t perform that action at this time.
0 commit comments