Skip to content

Commit 5cbb37f

Browse files
authored
Dont forcefully set service_name option on any exporter (#43)
Some exporters do not define this option (OTLP f.e.) and setting this option breaks them.
1 parent 2df74d4 commit 5cbb37f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/OtelSdkBundle/DependencyInjection/OtelSdkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ private function normalizeExporterOptions(array $config): array
320320
if (isset($config[Conf::URL_NODE])) {
321321
$options[Conf::URL_NODE] = $config[Conf::URL_NODE];
322322
}
323-
if (!isset($options[Conf::SERVICE_NAME_NODE])) {
323+
if (in_array(Conf::SERVICE_NAME_NODE, $definedOptions) && !isset($options[Conf::SERVICE_NAME_NODE])) {
324324
$options[Conf::SERVICE_NAME_NODE] = $this->serviceName;
325325
}
326326

0 commit comments

Comments
 (0)