@opentelemetry/otlp-transformer
Transform OpenTelemetry SDK data into OTLP
Last updated a month ago by GitHub Actions .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @opentelemetry/otlp-transformer 
SYNC missed versions from official npm registry.

OpenTelemetry Protocol

NPM Published Version Apache License

Note: This package is intended for internal use only.

Note: This is an experimental package under active development. New releases may include breaking changes.

This package provides everything needed to serialize OpenTelemetry SDK traces, metrics and logs into the OpenTelemetry Protocol format.

Quick Start

To get started you will need to install a compatible OpenTelemetry API.

Install Peer Dependencies

npm install @opentelemetry/api

Serialize Traces/Metrics/Logs

This module exports serializers to serialize traces, metrics and logs from the OpenTelemetry SDK into protocol buffers or JSON which can be sent over HTTP or gRPC (protobuf-only) to the OpenTelemetry collector or a compatible receiver.

import {
  JsonLogsSerializer,
  JsonMetricsSerializer,
  JsonTraceSerializer,
  ProtobufLogsSerializer,
  ProtobufMetricsSerializer,
  ProtobufTraceSerializer,
  IExportLogsServiceResponse,
  IExportMetricsServiceResponse,
  IExportTraceServiceResponse,
} from '@opentelemetry/otlp-transformer';

// serialize to JSON export requests
const serializedJsonLogs: Uint8Array = JsonLogsSerializer.serializeRequest(readableLogRecords);
const serializedJsonMetrics: Uint8Array = JsonMetricsSerializer.serializeRequest(resourceMetrics);
const serializedJsonTraces: Uint8Array = JsonTraceSerializer.serializeRequest(readableSpans);

// serialize to Protobuf export requests
const serializedProtobufLogs: Uint8Array = ProtobufLogsSerializer.serializeRequest(readableLogRecords);
const serializedProtobufMetrics: Uint8Array = ProtobufMetricsSerializer.serializeRequest(resourceMetrics);
const serializedProtobufTraces: Uint8Array = ProtobufTraceSerializer.serializeRequest(readableSpans);

// deserialize JSON export responses
const deserializedJsonLogResponse: IExportLogsServiceResponse = JsonLogsSerializer.deserializeResponse(jsonLogResponse);
const deserializedJsonMetricsResponse: IExportMetricsServiceResponse = JsonMetricsSerializer.deserializeResponse(jsonMetricsResponse);
const deserializedJsonTraceResponse: IExportTraceServiceResponse = JsonTraceSerializer.deserializeResponse(jsonTraceResponse);

// deserialize Protobuf export responses
const deserializedProtobufLogResponse: IExportLogsServiceResponse = ProtobufLogsSerializer.deserializeResponse(protobufLogResponse);
const deserializedProtobufMetricsResponse: IExportMetricsServiceResponse = ProtobufMetricsSerializer.deserializeResponse(protobufMetricsResponse);
const deserializedProtobufTraceResponse: IExportTraceServiceResponse = ProtobufTraceSerializer.deserializeResponse(protobufTraceResponse);

Useful links

License

Apache 2.0 - See LICENSE for more information.

Current Tags

  • 0.200.0-rc.1                                ...           canary (a year ago)
  • 0.213.0                                ...           latest (a month ago)
  • 0.34.0                                ...           next (3 years ago)

62 Versions

  • 0.213.0                                ...           a month ago
  • 0.212.0                                ...           2 months ago
  • 0.211.0                                ...           3 months ago
  • 0.210.0                                ...           3 months ago
  • 0.209.0                                ...           3 months ago
  • 0.208.0                                ...           5 months ago
  • 0.207.0                                ...           6 months ago
  • 0.206.0                                ...           6 months ago
  • 0.205.0                                ...           7 months ago
  • 0.204.0                                ...           7 months ago
  • 0.203.0                                ...           9 months ago
  • 0.202.0                                ...           10 months ago
  • 0.201.1                                ...           a year ago
  • 0.201.0                                ...           a year ago
  • 0.200.0                                ...           a year ago
  • 0.200.0-rc.1                                ...           a year ago
  • 0.200.0-dev.1                                ...           a year ago
  • 0.200.0-dev.0                                ...           a year ago
  • 0.57.2                                ...           a year ago
  • 0.57.1                                ...           a year ago
  • 0.57.0                                ...           a year ago
  • 0.56.0                                ...           a year ago
  • 0.55.0                                ...           a year ago
  • 0.54.2                                ...           a year ago
  • 0.54.1                                ...           a year ago
  • 0.54.0                                ...           a year ago
  • 0.53.0                                ...           2 years ago
  • 0.52.1                                ...           2 years ago
  • 0.52.0                                ...           2 years ago
  • 0.51.1                                ...           2 years ago
  • 0.51.0                                ...           2 years ago
  • 0.50.0                                ...           2 years ago
  • 0.49.1                                ...           2 years ago
  • 0.49.0                                ...           2 years ago
  • 0.48.0                                ...           2 years ago
  • 0.47.0                                ...           2 years ago
  • 0.46.0                                ...           2 years ago
  • 0.45.1                                ...           2 years ago
  • 0.45.0                                ...           2 years ago
  • 0.44.0                                ...           3 years ago
  • 0.43.0                                ...           3 years ago
  • 0.42.0                                ...           3 years ago
  • 0.41.2                                ...           3 years ago
  • 0.41.1                                ...           3 years ago
  • 0.41.0                                ...           3 years ago
  • 0.40.0                                ...           3 years ago
  • 0.39.1                                ...           3 years ago
  • 0.39.0                                ...           3 years ago
  • 0.38.0                                ...           3 years ago
  • 0.37.0                                ...           3 years ago
  • 0.36.1                                ...           3 years ago
  • 0.36.0                                ...           3 years ago
  • 0.35.1                                ...           3 years ago
  • 0.35.0                                ...           3 years ago
  • 0.34.0                                ...           3 years ago
  • 0.33.0                                ...           4 years ago
  • 0.32.0                                ...           4 years ago
  • 0.31.0                                ...           4 years ago
  • 0.30.0                                ...           4 years ago
  • 0.29.2                                ...           4 years ago
  • 0.29.1                                ...           4 years ago
  • 0.29.0                                ...           4 years ago

Copyright 2013 - present © cnpmjs.org | Home |