Skip to content

Commit 26574a7

Browse files
EmrysMyrddinenisdenjo
authored andcommitted
feat(opentelemetry): Exporters config is optional (#966)
1 parent 29a92db commit 26574a7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/nervous-carrots-allow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-mesh/plugin-opentelemetry': patch
3+
---
4+
5+
Fix the types exporters factories, the configuration is actually optional. All parameters can be determined from environement variables.

packages/plugins/opentelemetry/src/processors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ export function createStdoutExporter(
3939
}
4040

4141
export function createZipkinExporter(
42-
config: ZipkinExporterConfig,
42+
config?: ZipkinExporterConfig,
4343
batchingConfig?: BatchingConfig,
4444
): SpanProcessor {
4545
return resolveBatchingConfig(new ZipkinExporter(config), batchingConfig);
4646
}
4747

4848
export function createOtlpHttpExporter(
49-
config: OTLPExporterNodeConfigBase,
49+
config?: OTLPExporterNodeConfigBase,
5050
batchingConfig?: BatchingConfig,
5151
): SpanProcessor {
5252
return resolveBatchingConfig(new OtlpHttpExporter(config), batchingConfig);
@@ -86,7 +86,7 @@ function loadExporterLazily<
8686
}
8787

8888
export function createOtlpGrpcExporter(
89-
config: OTLPGRPCExporterConfigNode,
89+
config?: OTLPGRPCExporterConfigNode,
9090
batchingConfig?: BatchingConfig,
9191
): MaybePromise<SpanProcessor> {
9292
return handleMaybePromise(

0 commit comments

Comments
 (0)