forked from open-telemetry/opentelemetry-java-contrib
-
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.
Merge pull request #1 from robsunday/jmx-scrapper
Initial commit of JmxScraper code.
- Loading branch information
Showing
83 changed files
with
3,158 additions
and
388 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
28 changes: 28 additions & 0 deletions
28
...n/java/io/opentelemetry/contrib/awsxray/propagator/internal/AwsXrayComponentProvider.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,28 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.contrib.awsxray.propagator.internal; | ||
|
||
import io.opentelemetry.context.propagation.TextMapPropagator; | ||
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
|
||
public class AwsXrayComponentProvider implements ComponentProvider<TextMapPropagator> { | ||
@Override | ||
public Class<TextMapPropagator> getType() { | ||
return TextMapPropagator.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "xray"; | ||
} | ||
|
||
@Override | ||
public TextMapPropagator create(StructuredConfigProperties config) { | ||
return AwsXrayPropagator.getInstance(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
.../io/opentelemetry/contrib/awsxray/propagator/internal/AwsXrayLambdaComponentProvider.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,28 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.contrib.awsxray.propagator.internal; | ||
|
||
import io.opentelemetry.context.propagation.TextMapPropagator; | ||
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayLambdaPropagator; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider; | ||
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties; | ||
|
||
public class AwsXrayLambdaComponentProvider implements ComponentProvider<TextMapPropagator> { | ||
@Override | ||
public Class<TextMapPropagator> getType() { | ||
return TextMapPropagator.class; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "xray-lambda"; | ||
} | ||
|
||
@Override | ||
public TextMapPropagator create(StructuredConfigProperties config) { | ||
return AwsXrayLambdaPropagator.getInstance(); | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...s/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.ConfigurablePropagatorProvider
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 |
---|---|---|
@@ -1 +1 @@ | ||
io.opentelemetry.contrib.awsxray.propagator.AwsConfigurablePropagator | ||
io.opentelemetry.contrib.awsxray.propagator.internal.AwsConfigurablePropagator |
2 changes: 2 additions & 0 deletions
2
...urces/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider
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,2 @@ | ||
io.opentelemetry.contrib.awsxray.propagator.internal.AwsXrayComponentProvider | ||
io.opentelemetry.contrib.awsxray.propagator.internal.AwsXrayLambdaComponentProvider |
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
34 changes: 34 additions & 0 deletions
34
...t/java/io/opentelemetry/contrib/awsxray/propagator/internal/AwsComponentProviderTest.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 The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.contrib.awsxray.propagator.internal; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.opentelemetry.context.propagation.TextMapPropagator; | ||
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayLambdaPropagator; | ||
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator; | ||
import io.opentelemetry.sdk.OpenTelemetrySdk; | ||
import io.opentelemetry.sdk.extension.incubator.fileconfig.FileConfiguration; | ||
import java.io.ByteArrayInputStream; | ||
import java.nio.charset.StandardCharsets; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class AwsComponentProviderTest { | ||
|
||
@Test | ||
void endToEnd() { | ||
String yaml = "file_format: 0.1\n" + "propagator:\n" + " composite: [xray, xray-lambda]\n"; | ||
|
||
OpenTelemetrySdk openTelemetrySdk = | ||
FileConfiguration.parseAndCreate( | ||
new ByteArrayInputStream(yaml.getBytes(StandardCharsets.UTF_8))); | ||
TextMapPropagator expectedPropagator = | ||
TextMapPropagator.composite( | ||
AwsXrayPropagator.getInstance(), AwsXrayLambdaPropagator.getInstance()); | ||
assertThat(openTelemetrySdk.getPropagators().getTextMapPropagator().toString()) | ||
.isEqualTo(expectedPropagator.toString()); | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
...mpling/src/main/java/io/opentelemetry/contrib/sampler/consistent56/ComposableSampler.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,35 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.contrib.sampler.consistent56; | ||
|
||
import io.opentelemetry.api.common.Attributes; | ||
import io.opentelemetry.api.trace.SpanKind; | ||
import io.opentelemetry.context.Context; | ||
import io.opentelemetry.sdk.trace.data.LinkData; | ||
import java.util.List; | ||
|
||
/** An interface for components to be used by composite consistent probability samplers. */ | ||
public interface ComposableSampler { | ||
|
||
/** | ||
* Returns the SamplingIntent that is used for the sampling decision. The SamplingIntent includes | ||
* the threshold value which will be used for the sampling decision. | ||
* | ||
* <p>NOTE: Keep in mind, that in any case the returned threshold value must not depend directly | ||
* or indirectly on the random value. In particular this means that the parent sampled flag must | ||
* not be used for the calculation of the threshold as the sampled flag depends itself on the | ||
* random value. | ||
*/ | ||
SamplingIntent getSamplingIntent( | ||
Context parentContext, | ||
String name, | ||
SpanKind spanKind, | ||
Attributes attributes, | ||
List<LinkData> parentLinks); | ||
|
||
/** Return the string providing a description of the implementation. */ | ||
String getDescription(); | ||
} |
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.