From 3cdfb1b502194e99b3459123ab8d3bebcfe2de7a Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Wed, 21 Jun 2023 10:59:44 +0200 Subject: [PATCH 1/3] feat(otlp-exporters): bump otlp proto to 0.20.0 --- experimental/packages/otlp-grpc-exporter-base/protos | 2 +- .../src/LogsExportServiceClient.ts | 3 +-- .../src/MetricsExportServiceClient.ts | 6 ++++-- .../src/TraceExportServiceClient.ts | 6 ++++-- .../packages/otlp-proto-exporter-base/protos | 2 +- .../packages/otlp-transformer/src/common/types.ts | 6 ++++++ .../packages/otlp-transformer/src/logs/types.ts | 12 ++++++++++++ .../packages/otlp-transformer/src/metrics/types.ts | 12 ++++++++++++ .../packages/otlp-transformer/src/trace/types.ts | 12 ++++++++++++ 9 files changed, 53 insertions(+), 8 deletions(-) diff --git a/experimental/packages/otlp-grpc-exporter-base/protos b/experimental/packages/otlp-grpc-exporter-base/protos index c5c8b280125..1608f92cf08 160000 --- a/experimental/packages/otlp-grpc-exporter-base/protos +++ b/experimental/packages/otlp-grpc-exporter-base/protos @@ -1 +1 @@ -Subproject commit c5c8b28012583fda55b0cb16f73a820722171d49 +Subproject commit 1608f92cf08119f9aec237c910b200d1317ec696 diff --git a/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts b/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts index 148fca31a15..4c1e9d20803 100644 --- a/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts +++ b/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts @@ -16,9 +16,8 @@ import * as root from './generated/root'; import * as grpc from '@grpc/grpc-js'; -import { IExportLogsServiceRequest } from '@opentelemetry/otlp-transformer'; +import { IExportLogsServiceRequest, IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer'; import { ExportType } from './internal-types'; -import IExportLogsServiceResponse = root.opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse; const responseType = root.opentelemetry.proto.collector.logs.v1 .ExportLogsServiceResponse as ExportType; diff --git a/experimental/packages/otlp-grpc-exporter-base/src/MetricsExportServiceClient.ts b/experimental/packages/otlp-grpc-exporter-base/src/MetricsExportServiceClient.ts index 9a791ca2f3f..7f81be6087d 100644 --- a/experimental/packages/otlp-grpc-exporter-base/src/MetricsExportServiceClient.ts +++ b/experimental/packages/otlp-grpc-exporter-base/src/MetricsExportServiceClient.ts @@ -16,9 +16,11 @@ import * as root from './generated/root'; import * as grpc from '@grpc/grpc-js'; -import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer'; +import { + IExportMetricsServiceRequest, + IExportMetricsServiceResponse, +} from '@opentelemetry/otlp-transformer'; import { ExportType } from './internal-types'; -import IExportMetricsServiceResponse = root.opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse; const responseType = root.opentelemetry.proto.collector.metrics.v1 .ExportMetricsServiceResponse as ExportType; diff --git a/experimental/packages/otlp-grpc-exporter-base/src/TraceExportServiceClient.ts b/experimental/packages/otlp-grpc-exporter-base/src/TraceExportServiceClient.ts index 6a150a24b11..d332e4f4daa 100644 --- a/experimental/packages/otlp-grpc-exporter-base/src/TraceExportServiceClient.ts +++ b/experimental/packages/otlp-grpc-exporter-base/src/TraceExportServiceClient.ts @@ -16,9 +16,11 @@ import * as root from './generated/root'; import * as grpc from '@grpc/grpc-js'; -import { IExportTraceServiceRequest } from '@opentelemetry/otlp-transformer'; +import { + IExportTraceServiceRequest, + IExportTraceServiceResponse, +} from '@opentelemetry/otlp-transformer'; import { ExportType } from './internal-types'; -import IExportTraceServiceResponse = root.opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse; const responseType = root.opentelemetry.proto.collector.trace.v1 .ExportTraceServiceResponse as ExportType; diff --git a/experimental/packages/otlp-proto-exporter-base/protos b/experimental/packages/otlp-proto-exporter-base/protos index c5c8b280125..1608f92cf08 160000 --- a/experimental/packages/otlp-proto-exporter-base/protos +++ b/experimental/packages/otlp-proto-exporter-base/protos @@ -1 +1 @@ -Subproject commit c5c8b28012583fda55b0cb16f73a820722171d49 +Subproject commit 1608f92cf08119f9aec237c910b200d1317ec696 diff --git a/experimental/packages/otlp-transformer/src/common/types.ts b/experimental/packages/otlp-transformer/src/common/types.ts index 8b30231e743..159a595ba94 100644 --- a/experimental/packages/otlp-transformer/src/common/types.ts +++ b/experimental/packages/otlp-transformer/src/common/types.ts @@ -21,6 +21,12 @@ export interface IInstrumentationScope { /** InstrumentationScope version */ version?: string; + + /** InstrumentationScope attributes */ + attributes?: IKeyValue[]; + + /** InstrumentationScope droppedAttributesCount */ + droppedAttributesCount?: number; } /** Properties of a KeyValue. */ diff --git a/experimental/packages/otlp-transformer/src/logs/types.ts b/experimental/packages/otlp-transformer/src/logs/types.ts index 3d3e610bc74..f1334595495 100644 --- a/experimental/packages/otlp-transformer/src/logs/types.ts +++ b/experimental/packages/otlp-transformer/src/logs/types.ts @@ -27,6 +27,18 @@ export interface IExportLogsServiceRequest { resourceLogs?: IResourceLogs[]; } +export interface IExportLogsServiceResponse { + partialSuccess?: IExportLogsPartialSuccess; +} + +export interface IExportLogsPartialSuccess { + /** ExportLogsPartialSuccess rejectedLogRecords */ + rejectedLogRecords?: number; + + /** ExportLogsPartialSuccess errorMessage */ + errorMessage?: string; +} + /** Properties of a ResourceLogs. */ export interface IResourceLogs { /** ResourceLogs resource */ diff --git a/experimental/packages/otlp-transformer/src/metrics/types.ts b/experimental/packages/otlp-transformer/src/metrics/types.ts index 6db9c17a9be..dfabd4dd4ff 100644 --- a/experimental/packages/otlp-transformer/src/metrics/types.ts +++ b/experimental/packages/otlp-transformer/src/metrics/types.ts @@ -22,6 +22,18 @@ export interface IExportMetricsServiceRequest { resourceMetrics: IResourceMetrics[]; } +export interface IExportMetricsServiceResponse { + partialSuccess?: IExportMetricsPartialSuccess; +} + +export interface IExportMetricsPartialSuccess { + /** ExportMetricsPartialSuccess rejectedDataPoints */ + rejectedDataPoints?: number; + + /** ExportMetricsPartialSuccess errorMessage */ + errorMessage?: string; +} + /** Properties of a ResourceMetrics. */ export interface IResourceMetrics { /** ResourceMetrics resource */ diff --git a/experimental/packages/otlp-transformer/src/trace/types.ts b/experimental/packages/otlp-transformer/src/trace/types.ts index 08e52c7a06f..ccc384fdaab 100644 --- a/experimental/packages/otlp-transformer/src/trace/types.ts +++ b/experimental/packages/otlp-transformer/src/trace/types.ts @@ -23,6 +23,18 @@ export interface IExportTraceServiceRequest { resourceSpans?: IResourceSpans[]; } +export interface IExportTraceServiceResponse { + partialSuccess?: IExportTracePartialSuccess +} + +export interface IExportTracePartialSuccess { + /** ExportLogsServiceResponse rejectedLogRecords */ + rejectedSpans?: number; + + /** ExportLogsServiceResponse errorMessage */ + errorMessage?: string; +} + /** Properties of a ResourceSpans. */ export interface IResourceSpans { /** ResourceSpans resource */ From e3a6baf8aff10582d9e47727f45d271f89dcde15 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Wed, 21 Jun 2023 11:59:25 +0200 Subject: [PATCH 2/3] chore: fix lint/add changelog --- experimental/CHANGELOG.md | 1 + .../otlp-grpc-exporter-base/src/LogsExportServiceClient.ts | 5 ++++- experimental/packages/otlp-transformer/src/trace/types.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 1ac87111b5b..1291238caa8 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to experimental packages in this project will be documented ### :rocket: (Enhancement) * feat(otlp-grpc-exporters): add support for UDS endpoints. [#3853](https://github.com/open-telemetry/opentelemetry-js/pull/3853) @llc1123 +* feat(otlp-exporters): bump otlp proto to 0.20.0 [#3932](https://github.com/open-telemetry/opentelemetry-js/pull/3932) @pichlermarc ### :bug: (Bug Fix) diff --git a/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts b/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts index 4c1e9d20803..b867743cea7 100644 --- a/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts +++ b/experimental/packages/otlp-grpc-exporter-base/src/LogsExportServiceClient.ts @@ -16,7 +16,10 @@ import * as root from './generated/root'; import * as grpc from '@grpc/grpc-js'; -import { IExportLogsServiceRequest, IExportLogsServiceResponse } from '@opentelemetry/otlp-transformer'; +import { + IExportLogsServiceRequest, + IExportLogsServiceResponse, +} from '@opentelemetry/otlp-transformer'; import { ExportType } from './internal-types'; const responseType = root.opentelemetry.proto.collector.logs.v1 diff --git a/experimental/packages/otlp-transformer/src/trace/types.ts b/experimental/packages/otlp-transformer/src/trace/types.ts index ccc384fdaab..6f25d3e46d1 100644 --- a/experimental/packages/otlp-transformer/src/trace/types.ts +++ b/experimental/packages/otlp-transformer/src/trace/types.ts @@ -24,7 +24,7 @@ export interface IExportTraceServiceRequest { } export interface IExportTraceServiceResponse { - partialSuccess?: IExportTracePartialSuccess + partialSuccess?: IExportTracePartialSuccess; } export interface IExportTracePartialSuccess { From f90ebd3949170d04f8d4eba59e58320368fbea77 Mon Sep 17 00:00:00 2001 From: Marc Pichler Date: Wed, 21 Jun 2023 13:00:54 +0200 Subject: [PATCH 3/3] feat(otlp-transformer): add comments --- experimental/packages/otlp-transformer/src/logs/types.ts | 1 + experimental/packages/otlp-transformer/src/metrics/types.ts | 1 + experimental/packages/otlp-transformer/src/trace/types.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/experimental/packages/otlp-transformer/src/logs/types.ts b/experimental/packages/otlp-transformer/src/logs/types.ts index f1334595495..05709af6f52 100644 --- a/experimental/packages/otlp-transformer/src/logs/types.ts +++ b/experimental/packages/otlp-transformer/src/logs/types.ts @@ -28,6 +28,7 @@ export interface IExportLogsServiceRequest { } export interface IExportLogsServiceResponse { + /** ExportLogsServiceResponse partialSuccess */ partialSuccess?: IExportLogsPartialSuccess; } diff --git a/experimental/packages/otlp-transformer/src/metrics/types.ts b/experimental/packages/otlp-transformer/src/metrics/types.ts index dfabd4dd4ff..2728ab1abae 100644 --- a/experimental/packages/otlp-transformer/src/metrics/types.ts +++ b/experimental/packages/otlp-transformer/src/metrics/types.ts @@ -23,6 +23,7 @@ export interface IExportMetricsServiceRequest { } export interface IExportMetricsServiceResponse { + /** ExportMetricsServiceResponse partialSuccess */ partialSuccess?: IExportMetricsPartialSuccess; } diff --git a/experimental/packages/otlp-transformer/src/trace/types.ts b/experimental/packages/otlp-transformer/src/trace/types.ts index 6f25d3e46d1..a6cfb82ad7a 100644 --- a/experimental/packages/otlp-transformer/src/trace/types.ts +++ b/experimental/packages/otlp-transformer/src/trace/types.ts @@ -24,6 +24,7 @@ export interface IExportTraceServiceRequest { } export interface IExportTraceServiceResponse { + /** ExportTraceServiceResponse partialSuccess */ partialSuccess?: IExportTracePartialSuccess; }