Skip to content

Commit

Permalink
Merge branch 'main' into CustomTestInstructions
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc authored Oct 14, 2024
2 parents 01782ad + 6be903a commit a255043
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
* fix(resources): prevent circular import (resource -> detector -> resource -> ...) [#4653](https://github.com/open-telemetry/opentelemetry-js/pull/4653) @pichlermarc
* fixes a circular import warning which would appear in rollup when bundling `@opentelemetry/resources`
* fix(exporter-metrics-otlp-grpc): add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc [#4678](https://github.com/open-telemetry/opentelemetry-js/pull/4678) @AkselAllas
* fix(resources) wait for async attributes for detecting resources [#4687](https://github.com/open-telemetry/opentelemetry-js/pull/4687) @ziolekjj

## 1.24.0

Expand Down
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ All notable changes to experimental packages in this project will be documented
* `configureExporterTimeout`
* `invalidTimeout`
* fix(sdk-node): use warn instead of error on unknown OTEL_NODE_RESOURCE_DETECTORS values [#5034](https://github.com/open-telemetry/opentelemetry-js/pull/5034)
* fix(exporter-logs-otlp-proto): Use correct config type in Node constructor

### :books: (Refine Doc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

import {
OTLPExporterConfigBase,
OTLPExporterNodeBase,
OTLPExporterNodeConfigBase,
} from '@opentelemetry/otlp-exporter-base';
import {
IExportLogsServiceResponse,
Expand All @@ -37,7 +37,7 @@ export class OTLPLogExporter
extends OTLPExporterNodeBase<ReadableLogRecord, IExportLogsServiceResponse>
implements LogRecordExporter
{
constructor(config: OTLPExporterConfigBase = {}) {
constructor(config: OTLPExporterNodeConfigBase = {}) {
super(
config,
ProtobufLogsSerializer,
Expand Down
1 change: 1 addition & 0 deletions packages/opentelemetry-resources/src/detect-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const detectResourcesSync = (
if (isPromiseLike<Resource>(resourceOrPromise)) {
const createPromise = async () => {
const resolvedResource = await resourceOrPromise;
await resolvedResource.waitForAsyncAttributes?.();
return resolvedResource.attributes;
};
resource = new Resource({}, createPromise());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ describe('detectResourcesSync', () => {
it('handles resource detectors which return Promise<Resource>', async () => {
const detector: Detector = {
async detect() {
return new Resource({ sync: 'fromsync' });
return new Resource(
{ sync: 'fromsync' },
Promise.resolve().then(() => ({ async: 'fromasync' }))
);
},
};
const resource = detectResourcesSync({
Expand All @@ -38,6 +41,7 @@ describe('detectResourcesSync', () => {
await resource.waitForAsyncAttributes?.();
assert.deepStrictEqual(resource.attributes, {
sync: 'fromsync',
async: 'fromasync',
});
});

Expand Down

0 comments on commit a255043

Please sign in to comment.