You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(otel): add support for otel metrics api via protobuf and json (#6783)
* add otlp metrics protos
* feat: add OTLP metrics proto definitions and reorganize directory
- Add metrics.proto and metrics_service.proto (OTLP v1 spec)
- Update protobuf_loader to support metrics protos
- Rename protos/ -> otlp/ directory for better organization
* refactor: extract common OTLP logic into base classes
- Create OtlpHttpExporterBase for shared HTTP export logic
- Create OtlpTransformerBase for shared transformation logic
- Refactor logs exporter/transformer to extend base classes
- Update test mocking paths
- Eliminates ~400 lines of duplication
* fix logs
* increase test coverage
* feat(metrics): add support for otel metrics provider
* feat(metrics): add support for otlp configurations
* updates to pass system tests
* add temperolality support and clean up implementation
* add support for encoding attributes
* simplify tests
* use real values in tests
* do not encode numbers as strings
* use enum in transformation
* remove unneed fields
* add better temporality support and include encoding for async metric types
* improve test coverage for scope attributes
* simplify stubs in tests
* validate scope attributes
* ruben comments
* fix broken number test
* clean up tests
* clean up instruments and update tests
* simplify meter
* use constants and implement missing callbacks
* move otlp_transformer changes over
* clean up private/public fields
* avoid redefining constant
* clean up tests
* update typing
* linting clean ups
* first round of changes from cr
* limit number of metrics in each batch
* round 3 changes
* address more comments part 4
* update doc strings and typing
* update max batch size to operate on the aggregate metrics
* avoid converting aggregated metrics to arrays, perf
* fix regression in logs implementation
* revert closure
* cleanup max measurement queue, jdocs and typing
* log warning if value is invalid
* final set of changes
* update tests to be compatible with master branch
* remove register from meter provider and simplify export
* clean up stable stringify and update limit of max queue size
* remove @Private from metrics docs
* only implement the meterprovider api, renove shutdown and forceflush operations
* remove observableInstruments
* lint
* fix linting failures
* fix linting failures
* fix linting 3
-`OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` - OTLP endpoint URL for logs(default: `http://localhost:4318`)
412
-
-`OTEL_EXPORTER_OTLP_LOGS_HEADERS` - Optional headers in JSON format for logs (default: `{}`)
413
-
-`OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` - OTLP protocol for logs (default: `http/protobuf`)
414
-
-`OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` - Request timeout in milliseconds for logs (default: `10000`)
415
-
-`OTEL_BSP_SCHEDULE_DELAY` - Batch timeout in milliseconds (default: `5000`)
411
+
-`OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` - OTLP endpoint URL for logs. Falls back to `OTEL_EXPORTER_OTLP_ENDPOINT` with `/v1/logs` appended (default: `http://localhost:4318/v1/logs`)
412
+
-`OTEL_EXPORTER_OTLP_LOGS_HEADERS` - Optional headers for logs in JSON format. Falls back to `OTEL_EXPORTER_OTLP_HEADERS` (default: `{}`)
413
+
-`OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` - OTLP protocol for logs. Options: `http/protobuf`, `http/json`. Falls back to `OTEL_EXPORTER_OTLP_PROTOCOL` (default: `http/protobuf`)
414
+
-`OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` - Request timeout in milliseconds for logs. Falls back to `OTEL_EXPORTER_OTLP_TIMEOUT` (default: `10000`)
415
+
-`OTEL_BSP_SCHEDULE_DELAY` - Batch export delay in milliseconds (default: `5000`)
416
416
-`OTEL_BSP_MAX_EXPORT_BATCH_SIZE` - Maximum logs per batch (default: `512`)
417
+
-`OTEL_BSP_MAX_QUEUE_SIZE` - Maximum logs to queue before dropping (default: `2048`)
417
418
418
-
Logs are exported via OTLP over HTTP. The protocol can be configured using `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` or `OTEL_EXPORTER_OTLP_PROTOCOL` environment variables. Supported protocols are `http/protobuf` (default) and `http/json`. For complete OTLP exporter configuration options, see the [OpenTelemetry OTLP Exporter documentation](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).
419
+
For complete OTLP exporter configuration options, see the [OpenTelemetry OTLP Exporter documentation](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).
dd-trace-js includes experimental support for OpenTelemetry metrics, designed as a drop-in replacement for the OpenTelemetry Metrics SDK. This lightweight implementation is fully compliant with the OpenTelemetry Metrics API and integrates with the existing OTLP export infrastructure. Enable it by setting `DD_METRICS_OTEL_ENABLED=true` and use the [OpenTelemetry Metrics API](https://open-telemetry.github.io/opentelemetry-js/modules/_opentelemetry_api.html) to record metric data:
-`OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` - OTLP endpoint URL for metrics. Falls back to `OTEL_EXPORTER_OTLP_ENDPOINT` with `/v1/metrics` appended (default: `http://localhost:4318/v1/metrics`)
470
+
-`OTEL_EXPORTER_OTLP_METRICS_HEADERS` - Optional headers for metrics in JSON format. Falls back to `OTEL_EXPORTER_OTLP_HEADERS` (default: `{}`)
471
+
-`OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` - OTLP protocol for metrics. Options: `http/protobuf`, `http/json`. Falls back to `OTEL_EXPORTER_OTLP_PROTOCOL` (default: `http/protobuf`)
472
+
-`OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` - Request timeout in milliseconds for metrics. Falls back to `OTEL_EXPORTER_OTLP_TIMEOUT` (default: `10000`)
473
+
-`OTEL_METRIC_EXPORT_INTERVAL` - Metric export interval in milliseconds (default: `10000`)
474
+
-`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` - Aggregation temporality preference. Options: `CUMULATIVE`, `DELTA`, `LOWMEMORY` (default: `DELTA`). See [OpenTelemetry spec](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/#additional-environment-variable-configuration) for details
475
+
-`OTEL_BSP_MAX_QUEUE_SIZE` - Maximum metrics to queue before dropping (default: `2048`)
476
+
-`OTEL_METRIC_EXPORT_TIMEOUT` - [NOT YET SUPPORTED] Time to export metrics including retries
477
+
478
+
For complete OTLP exporter configuration options, see the [OpenTelemetry OTLP Exporter documentation](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).
0 commit comments