forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement zipkin exporter provider (open-telemetry#4991)
- Loading branch information
Showing
7 changed files
with
67 additions
and
35 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
43 changes: 43 additions & 0 deletions
43
...n/src/main/java/io/opentelemetry/exporter/zipkin/internal/ZipkinSpanExporterProvider.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,43 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.exporter.zipkin.internal; | ||
|
||
import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter; | ||
import io.opentelemetry.exporter.zipkin.ZipkinSpanExporterBuilder; | ||
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties; | ||
import io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider; | ||
import io.opentelemetry.sdk.trace.export.SpanExporter; | ||
import java.time.Duration; | ||
|
||
/** | ||
* {@link SpanExporter} SPI implementation for {@link ZipkinSpanExporter}. | ||
* | ||
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change | ||
* at any time. | ||
*/ | ||
public class ZipkinSpanExporterProvider implements ConfigurableSpanExporterProvider { | ||
@Override | ||
public String getName() { | ||
return "zipkin"; | ||
} | ||
|
||
@Override | ||
public SpanExporter createExporter(ConfigProperties config) { | ||
ZipkinSpanExporterBuilder builder = ZipkinSpanExporter.builder(); | ||
|
||
String endpoint = config.getString("otel.exporter.zipkin.endpoint"); | ||
if (endpoint != null) { | ||
builder.setEndpoint(endpoint); | ||
} | ||
|
||
Duration timeout = config.getDuration("otel.exporter.zipkin.timeout"); | ||
if (timeout != null) { | ||
builder.setReadTimeout(timeout); | ||
} | ||
|
||
return builder.build(); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...F/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider
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 @@ | ||
io.opentelemetry.exporter.zipkin.internal.ZipkinSpanExporterProvider |
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