-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for OTEL_RESOURCE_ATTRIBUTES, OTEL_SERVICE_NAME, OTEL_EXP…
…ORTER_OTLP_HEADERS and OTEL_EXPORTER_OTLP_PROTOCOL for spring boot starter (#9950)
- Loading branch information
1 parent
67facf3
commit 87615cc
Showing
30 changed files
with
772 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...etry/instrumentation/spring/autoconfigure/exporters/internal/ExporterConfigEvaluator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.spring.autoconfigure.exporters.internal; | ||
|
||
import java.util.Arrays; | ||
import javax.annotation.Nullable; | ||
import org.springframework.core.env.Environment; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
public final class ExporterConfigEvaluator { | ||
|
||
private ExporterConfigEvaluator() {} | ||
|
||
public static boolean isExporterEnabled( | ||
Environment environment, | ||
@Nullable String oldAllKey, | ||
String oldKey, | ||
String exportersKey, | ||
String wantExporter, | ||
boolean defaultValue) { | ||
|
||
String exporter = environment.getProperty(exportersKey); | ||
if (exporter != null) { | ||
return Arrays.asList(exporter.split(",")).contains(wantExporter); | ||
} | ||
|
||
String old = environment.getProperty(oldKey); | ||
if (old != null) { | ||
return "true".equals(old); | ||
} | ||
if (oldAllKey != null) { | ||
String oldAll = environment.getProperty(oldAllKey); | ||
if (oldAll != null) { | ||
return "true".equals(oldAll); | ||
} | ||
} | ||
return defaultValue; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.