-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from williamhu99/initial
Create base module for zPages
- Loading branch information
Showing
6 changed files
with
172 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# OpenTelemetry SDK Contrib - zPages | ||
|
||
[![Javadocs][javadoc-image]][javadoc-url] | ||
|
||
This module contains code for OpenTelemetry's Java zPages. | ||
|
||
<!--- TODO: Update javadoc --> | ||
[javadoc-image]: https://www.javadoc.io/badge/io.opentelemetry/opentelemetry-sdk-contrib-auto-config.svg | ||
[javadoc-url]: https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-contrib-auto-config |
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,16 @@ | ||
plugins { | ||
id "java" | ||
id "maven-publish" | ||
|
||
id "ru.vyarus.animalsniffer" | ||
} | ||
|
||
description = 'OpenTelemetry - zPages' | ||
ext.moduleName = "io.opentelemetry.sdk.contrib.zpages" | ||
|
||
dependencies { | ||
api project(':opentelemetry-api'), | ||
project(':opentelemetry-sdk') | ||
|
||
signature "org.codehaus.mojo.signature:java17:1.0@signature" | ||
} |
78 changes: 78 additions & 0 deletions
78
sdk_contrib/zpages/src/main/java/io/opentelemetry/sdk/contrib/zpages/Config.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,78 @@ | ||
/* | ||
* Copyright 2020, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.opentelemetry.sdk.contrib.zpages; | ||
|
||
/** | ||
* An interface used to provide configuration information to {@link SpanExporterFactory} | ||
* implementations. Callers (such as the Java Auto Instrumenter) typically provide an implementation | ||
* mapping directly to their native configuration framework. | ||
* | ||
* <p>This interface is intentionally kept very simple since the underlying implementations may only | ||
* have access to very basic configuration mechanisms such as system properties and environment | ||
* variables. | ||
*/ | ||
public interface Config { | ||
/** | ||
* Returns the string configuration property corresponding to a key. If the underlying | ||
* implementation cannot find a property for the key, {@code defaultValue} is returned. | ||
* | ||
* @param key The config key | ||
* @param defaultValue The value to use if no configuration property couldn't be found | ||
* @return The value of the configuration parameter | ||
*/ | ||
String getString(String key, String defaultValue); | ||
|
||
/** | ||
* Returns the {@code int} configuration property corresponding to a key. If the underlying | ||
* implementation cannot find a property for the key, {@code defaultValue} is returned. | ||
* | ||
* @param key The config key | ||
* @param defaultValue The value to use if no configuration property couldn't be found | ||
* @return The value of the configuration parameter | ||
*/ | ||
int getInt(String key, int defaultValue); | ||
|
||
/** | ||
* Returns the {@code long} configuration property corresponding to a key. If the underlying | ||
* implementation cannot find a property for the key, {@code defaultValue} is returned. | ||
* | ||
* @param key The config key | ||
* @param defaultValue The value to use if no configuration property couldn't be found | ||
* @return The value of the configuration parameter | ||
*/ | ||
long getLong(String key, long defaultValue); | ||
|
||
/** | ||
* Returns the {@code boolean} configuration property corresponding to a key. If the underlying | ||
* implementation cannot find a property for the key, {@code defaultValue} is returned. | ||
* | ||
* @param key The config key | ||
* @param defaultValue The value to use if no configuration property couldn't be found | ||
* @return The value of the configuration parameter | ||
*/ | ||
boolean getBoolean(String key, boolean defaultValue); | ||
|
||
/** | ||
* Returns the {@code double} configuration property corresponding to a key. If the underlying | ||
* implementation cannot find a property for the key, {@code defaultValue} is returned. | ||
* | ||
* @param key The config key | ||
* @param defaultValue The value to use if no configuration property couldn't be found | ||
* @return The value of the configuration parameter | ||
*/ | ||
double getDouble(String key, double defaultValue); | ||
} |
34 changes: 34 additions & 0 deletions
34
...ntrib/zpages/src/main/java/io/opentelemetry/sdk/contrib/zpages/MetricExporterFactory.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,34 @@ | ||
/* | ||
* Copyright 2020, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.opentelemetry.sdk.contrib.zpages; | ||
|
||
import io.opentelemetry.sdk.metrics.export.MetricExporter; | ||
|
||
/** | ||
* A {@link MetricExporterFactory} acts as the bootstrap for a {@link MetricExporter} | ||
* implementation. An exporter must register its implementation of a {@link MetricExporterFactory} | ||
* through the Java SPI framework. | ||
*/ | ||
public interface MetricExporterFactory { | ||
/** | ||
* Creates an instance of a {@link MetricExporter} based on the provided configuration. | ||
* | ||
* @param config The configuration | ||
* @return An implementation of a {@link MetricExporter} | ||
*/ | ||
MetricExporter fromConfig(Config config); | ||
} |
34 changes: 34 additions & 0 deletions
34
...contrib/zpages/src/main/java/io/opentelemetry/sdk/contrib/zpages/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,34 @@ | ||
/* | ||
* Copyright 2020, OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.opentelemetry.sdk.contrib.zpages; | ||
|
||
import io.opentelemetry.sdk.trace.export.SpanExporter; | ||
|
||
/** | ||
* A {@link SpanExporterFactory} acts as the bootstrap for a {@link SpanExporter} implementation. An | ||
* exporter must register its implementation of a {@link SpanExporterFactory} through the Java SPI | ||
* framework. | ||
*/ | ||
public interface SpanExporterFactory { | ||
/** | ||
* Creates an instance of a {@link SpanExporter} based on the provided configuration. | ||
* | ||
* @param config The configuration | ||
* @return An implementation of a {@link SpanExporter} | ||
*/ | ||
SpanExporter fromConfig(Config config); | ||
} |
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