Skip to content

Commit

Permalink
fix(grpc-exporter): use simplified syntax to determine url
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc committed Jun 8, 2022
1 parent d41f92a commit 743aa7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ export class OTLPTraceExporter
getUrlFromConfig(config: OTLPGRPCExporterConfigNode): string {
if (typeof config.url === 'string') {
return config.url;
} else if (getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0) {
return getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;
} else if (getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {
return getEnv().OTEL_EXPORTER_OTLP_ENDPOINT;
} else {
return DEFAULT_COLLECTOR_URL;
}

return getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT ||
getEnv().OTEL_EXPORTER_OTLP_ENDPOINT ||
DEFAULT_COLLECTOR_URL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ class OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<ResourceMetrics,
getUrlFromConfig(config: OTLPGRPCExporterConfigNode): string {
if (typeof config.url === 'string') {
return config.url;
} else if (getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length > 0) {
return getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT;
} else if (getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0) {
return getEnv().OTEL_EXPORTER_OTLP_ENDPOINT;
} else {
return DEFAULT_COLLECTOR_URL;
}

return getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT ||
getEnv().OTEL_EXPORTER_OTLP_ENDPOINT ||
DEFAULT_COLLECTOR_URL;
}
}

Expand Down

0 comments on commit 743aa7c

Please sign in to comment.