Skip to content

Commit

Permalink
Merge pull request #1 from williamhu99/initial
Browse files Browse the repository at this point in the history
Create base module for zPages
  • Loading branch information
v-y-l authored Jun 2, 2020
2 parents 2577fc7 + fb96034 commit 42ace25
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sdk_contrib/zpages/README.md
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
16 changes: 16 additions & 0 deletions sdk_contrib/zpages/build.gradle
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"
}
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);
}
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);
}
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);
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ include ":opentelemetry-all",
":opentelemetry-sdk-contrib-otproto",
":opentelemetry-sdk-contrib-testbed",
":opentelemetry-sdk-contrib-jaeger-remote-sampler",
":opentelemetry-sdk-contrib-zpages",
":opentelemetry-bom"

rootProject.children.each {
Expand Down

0 comments on commit 42ace25

Please sign in to comment.