Skip to content

Commit

Permalink
Merge branch 'main' into feat/remove-unused-serializer-exports
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc authored Nov 28, 2024
2 parents 57e6439 + fd7f2d9 commit 55a75ca
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Before creating a pull request, please make sure:
- You have read the guide for contributing
- See https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md
- You signed all your commits (otherwise we won't be able to merge the PR)
- See https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#sign-the-cla
- See https://github.com/open-telemetry/community/blob/main/guides/contributor#sign-the-cla
- You added unit tests for the new functionality
- You mention in the PR description which issue it is addressing, e.g. "Fixes #xxx". This will auto-close
the issue that your PR fixes (if such)
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Reporting bugs is an important contribution. Please make sure to include:
### Before you start

Please read project contribution
[guide](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md)
[guide](https://github.com/open-telemetry/community/blob/main/guides/contributor)
for general practices for OpenTelemetry project.

#### Conventional commit
Expand Down Expand Up @@ -145,7 +145,7 @@ git merge upstream/main

Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in main.

Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#github-workflow) section of general project contributing guide.
Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/guides/contributor/processes.md#github-workflow) section of general project contributing guide.

## Development

Expand Down
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ All notable changes to experimental packages in this project will be documented
* feat(otlp-exporter-base): internally accept a http header provider function only [#5179](https://github.com/open-telemetry/opentelemetry-js/pull/5179) @pichlermarc
* refactor(otlp-exporter-base): don't create blob before sending xhr [#5193](https://github.com/open-telemetry/opentelemetry-js/pull/5193) @pichlermarc
* improves compatibility with some unsupported runtimes
* feat(otlp-exporter-base): add http response body to exporter error [#5204](https://github.com/open-telemetry/opentelemetry-js/pull/5204) @pichlermarc

### :bug: (Bug Fix)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"access": "public"
},
"devDependencies": {
"@bufbuild/buf": "1.21.0-1",
"@bufbuild/buf": "1.47.2",
"@grpc/grpc-js": "^1.7.1",
"@grpc/proto-loader": "^0.7.10",
"@opentelemetry/api": "1.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@types/semver": "7.5.8",
"@types/sinon": "17.0.3",
"@types/superagent": "8.1.9",
"axios": "1.7.4",
"axios": "1.7.8",
"cross-var": "1.1.0",
"lerna": "6.6.2",
"mocha": "10.8.2",
Expand Down
6 changes: 1 addition & 5 deletions experimental/packages/otlp-exporter-base/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,5 @@ export {
CompressionAlgorithm,
} from './configuration/legacy-node-configuration';
export { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';
export {
createOtlpExportDelegate,
IOtlpExportDelegate,
} from './otlp-export-delegate';
export { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';
export { IOtlpExportDelegate } from './otlp-export-delegate';
export { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export function sendWithHttp(
retryInMillis: parseRetryAfterToMills(res.headers['retry-after']),
});
} else {
const error = new OTLPExporterError(res.statusMessage, res.statusCode);
const error = new OTLPExporterError(
res.statusMessage,
res.statusCode,
Buffer.concat(responseData).toString()
);
onDone({
status: 'failure',
error,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createBoundedQueueExportPromiseHandler } from '../../src';
import { createBoundedQueueExportPromiseHandler } from '../../src/bounded-queue-export-promise-handler';
import * as assert from 'assert';

describe('BoundedQueueExportPromiseHandler', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as sinon from 'sinon';
import * as assert from 'assert';
import { IExporterTransport } from '../../src';
import { ExportResultCode } from '@opentelemetry/core';
import { createOtlpExportDelegate } from '../../src';
import { createOtlpExportDelegate } from '../../src/otlp-export-delegate';
import { ExportResponse } from '../../src';
import { ISerializer } from '@opentelemetry/otlp-transformer';
import { IExportPromiseHandler } from '../../src/bounded-queue-export-promise-handler';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
ExportResponseRetryable,
ExportResponseFailure,
ExportResponseSuccess,
OTLPExporterError,
} from '../../src';
import * as zlib from 'zlib';

Expand Down Expand Up @@ -123,7 +124,7 @@ describe('HttpExporterTransport', function () {
// arrange
server = http.createServer((_, res) => {
res.statusCode = 404;
res.end();
res.end('response-body');
});
server.listen(8080);

Expand All @@ -143,6 +144,14 @@ describe('HttpExporterTransport', function () {
(result as ExportResponseFailure).error.message,
'Not Found'
);
assert.strictEqual(
((result as ExportResponseFailure).error as OTLPExporterError).data,
'response-body'
);
assert.strictEqual(
((result as ExportResponseFailure).error as OTLPExporterError).code,
404
);
});

it('returns failure when request times out', function (done) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@opentelemetry/context-async-hooks": "1.28.0",
"@opentelemetry/core": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"axios": "1.7.4",
"axios": "1.7.8",
"body-parser": "1.20.3",
"express": "4.20.0"
},
Expand Down
Loading

0 comments on commit 55a75ca

Please sign in to comment.