-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: suranjay <[email protected]>
- Loading branch information
Showing
8 changed files
with
67 additions
and
15 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
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
24 changes: 24 additions & 0 deletions
24
...ns/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/SpanExporterFactory.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,24 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.telemetry.tracing; | ||
|
||
import io.opentelemetry.exporter.logging.LoggingSpanExporter; | ||
import io.opentelemetry.sdk.trace.export.SpanExporter; | ||
|
||
public class SpanExporterFactory { | ||
|
||
public SpanExporter create(SpanExporterType exporterType) { | ||
switch (exporterType) { | ||
case LOGGING: | ||
return LoggingSpanExporter.create(); | ||
case OLTP_GRPC: | ||
return | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/SpanExporterType.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,27 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.telemetry.tracing; | ||
|
||
import java.util.Arrays; | ||
|
||
public enum SpanExporterType { | ||
|
||
LOGGING, OLTP_GRPC; | ||
|
||
public static SpanExporterType fromString(String name) { | ||
for (SpanExporterType level : values()) { | ||
if (level.name().equalsIgnoreCase(name)) { | ||
return level; | ||
} | ||
} | ||
throw new IllegalArgumentException( | ||
"invalid value for tracing level [" + name + "], " + "must be in " + Arrays.asList(SpanExporterType.values()) | ||
); | ||
} | ||
} |