diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index defff18a1a9..db7230405a0 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -9,6 +9,7 @@ For notes on migrating to 2.x / 0.200.x see [the upgrade guide](doc/upgrade-to-2 ### :boom: Breaking Changes * feat(configuration)!: rename OTEL_EXPERIMENTAL_CONFIG_FILE to OTEL_CONFIG_FILE [#6486](https://github.com/open-telemetry/opentelemetry-js/pull/6486) @maryliag +* refactor!(otlp-grpc-exporter-base): remove `headers` from gRPC exporter config type, passing headers now results in a compile-time error instead of being silently ignored [#6487](https://github.com/open-telemetry/opentelemetry-js/pull/6487) ### :rocket: Features diff --git a/experimental/packages/otlp-grpc-exporter-base/src/configuration/convert-legacy-otlp-grpc-options.ts b/experimental/packages/otlp-grpc-exporter-base/src/configuration/convert-legacy-otlp-grpc-options.ts index 02d87778121..1733f920a59 100644 --- a/experimental/packages/otlp-grpc-exporter-base/src/configuration/convert-legacy-otlp-grpc-options.ts +++ b/experimental/packages/otlp-grpc-exporter-base/src/configuration/convert-legacy-otlp-grpc-options.ts @@ -3,7 +3,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import type { OTLPGRPCExporterConfigNode } from '../types'; -import { diag } from '@opentelemetry/api'; import type { OtlpGrpcConfiguration } from './otlp-grpc-configuration'; import { getOtlpGrpcDefaultConfiguration, @@ -21,10 +20,6 @@ export function convertLegacyOtlpGrpcOptions( config: OTLPGRPCExporterConfigNode, signalIdentifier: string ): OtlpGrpcConfiguration { - if (config.headers) { - diag.warn('Headers cannot be set when using grpc'); - } - // keep credentials locally in case user updates the reference on the config object const userProvidedCredentials = config.credentials; return mergeOtlpGrpcConfigurationWithDefaults( diff --git a/experimental/packages/otlp-grpc-exporter-base/src/types.ts b/experimental/packages/otlp-grpc-exporter-base/src/types.ts index ea2d86c18d6..ee4aaad2bb3 100644 --- a/experimental/packages/otlp-grpc-exporter-base/src/types.ts +++ b/experimental/packages/otlp-grpc-exporter-base/src/types.ts @@ -4,7 +4,6 @@ */ import type { ChannelCredentials, Metadata } from '@grpc/grpc-js'; - import type { CompressionAlgorithm, OTLPExporterConfigBase, @@ -13,7 +12,8 @@ import type { /** * OTLP Exporter Config for Node */ -export interface OTLPGRPCExporterConfigNode extends OTLPExporterConfigBase { +export interface OTLPGRPCExporterConfigNode + extends Omit { credentials?: ChannelCredentials; metadata?: Metadata; compression?: CompressionAlgorithm;