diff --git a/CHANGELOG.md b/CHANGELOG.md index daa351e51d..651c54da10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :bug: (Bug Fix) +* fix(otlp-proto-exporter-base): Match Accept header with Content-Type in the proto exporter + [#3562](https://github.com/open-telemetry/opentelemetry-js/pull/3562) @scheler + ### :books: (Refine Doc) ### :house: (Internal) diff --git a/experimental/packages/otlp-proto-exporter-base/scripts/protos.js b/experimental/packages/otlp-proto-exporter-base/scripts/protos.js index e06cc9db44..3f3fbd6c0c 100644 --- a/experimental/packages/otlp-proto-exporter-base/scripts/protos.js +++ b/experimental/packages/otlp-proto-exporter-base/scripts/protos.js @@ -45,6 +45,7 @@ async function pbjs(files) { const outFile = path.join(generatedPath, 'root.js'); const pbjsOptions = [ '-t', 'static-module', + '-p', protosPath, '-w', 'commonjs', '--null-defaults', '-o', outFile, diff --git a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts b/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts index 1b386855e4..4e9f95d5c0 100644 --- a/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts +++ b/experimental/packages/otlp-proto-exporter-base/src/platform/browser/OTLPProtoExporterBrowserBase.ts @@ -75,7 +75,11 @@ export abstract class OTLPProtoExporterBrowserBase< sendWithXhr( new Blob([body], { type: 'application/x-protobuf' }), this.url, - { ...this._headers, 'Content-Type': 'application/x-protobuf' }, + { + ...this._headers, + 'Content-Type': 'application/x-protobuf', + Accept: 'application/x-protobuf', + }, this.timeoutMillis, onSuccess, onError diff --git a/experimental/packages/otlp-transformer/package.json b/experimental/packages/otlp-transformer/package.json index ba4462f5c5..cd1641edcc 100644 --- a/experimental/packages/otlp-transformer/package.json +++ b/experimental/packages/otlp-transformer/package.json @@ -66,7 +66,7 @@ "karma-mocha": "2.0.1", "karma-spec-reporter": "0.0.32", "karma-webpack": "4.0.2", - "mkdirp": "1.0.4", + "mkdirp": "2.1.3", "mocha": "10.0.0", "nyc": "15.1.0", "rimraf": "3.0.2",