Skip to content

Commit 352202f

Browse files
authored
Merge pull request #1 from robsunday/jmx-scrapper
Initial commit of JmxScraper code.
2 parents 5a82aac + 40a2591 commit 352202f

File tree

83 files changed

+3158
-388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3158
-388
lines changed

.github/component_owners.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ components:
4141
- sfriberg
4242
jmx-metrics:
4343
- breedx-splk
44+
jmx-scraper:
45+
- breedx-splk
46+
- robsunday
47+
- sylvainjuge
4448
maven-extension:
4549
- cyrille-leclerc
4650
- kenfinnigan
@@ -61,6 +65,7 @@ components:
6165
- jeanbisutti
6266
samplers:
6367
- trask
68+
- jack-berg
6469
static-instrumenter:
6570
- anosek-an
6671
kafka-exporter:

aws-xray-propagator/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ dependencies {
1313
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
1414
testImplementation("io.opentelemetry:opentelemetry-sdk-trace")
1515
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
16+
17+
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-incubator")
1618
testImplementation("uk.org.webcompere:system-stubs-jupiter:2.0.3")
1719
}

aws-xray-propagator/src/main/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayLambdaPropagator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ public <C> Context extract(Context context, @Nullable C carrier, TextMapGetter<C
7979
MapGetter.INSTANCE);
8080
}
8181

82+
@Override
83+
public String toString() {
84+
return "AwsXrayLambdaPropagator";
85+
}
86+
8287
private static boolean isEmptyOrNull(@Nullable String value) {
8388
return value == null || value.isEmpty();
8489
}

aws-xray-propagator/src/main/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayPropagator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ public <C> Context extract(Context context, @Nullable C carrier, TextMapGetter<C
169169
return getContextFromHeader(context, carrier, getter);
170170
}
171171

172+
@Override
173+
public String toString() {
174+
return "AwsXrayPropagator";
175+
}
176+
172177
private static <C> Context getContextFromHeader(
173178
Context context, @Nullable C carrier, TextMapGetter<C> getter) {
174179
String traceHeader = getter.get(carrier, TRACE_HEADER_KEY);
@@ -290,7 +295,8 @@ private static String parseShortTraceId(String xrayTraceId) {
290295
int secondDelimiter = xrayTraceId.indexOf(TRACE_ID_DELIMITER, firstDelimiter + 2);
291296
if (firstDelimiter != TRACE_ID_DELIMITER_INDEX_1
292297
|| secondDelimiter == -1
293-
|| secondDelimiter > TRACE_ID_DELIMITER_INDEX_2) {
298+
|| secondDelimiter > TRACE_ID_DELIMITER_INDEX_2
299+
|| xrayTraceId.length() < secondDelimiter + 25) {
294300
return TraceId.getInvalid();
295301
}
296302

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package io.opentelemetry.contrib.awsxray.propagator;
6+
package io.opentelemetry.contrib.awsxray.propagator.internal;
77

88
import io.opentelemetry.context.propagation.TextMapPropagator;
9+
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator;
910
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
1011
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurablePropagatorProvider;
1112

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.contrib.awsxray.propagator.internal;
7+
8+
import io.opentelemetry.context.propagation.TextMapPropagator;
9+
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayPropagator;
10+
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider;
11+
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties;
12+
13+
public class AwsXrayComponentProvider implements ComponentProvider<TextMapPropagator> {
14+
@Override
15+
public Class<TextMapPropagator> getType() {
16+
return TextMapPropagator.class;
17+
}
18+
19+
@Override
20+
public String getName() {
21+
return "xray";
22+
}
23+
24+
@Override
25+
public TextMapPropagator create(StructuredConfigProperties config) {
26+
return AwsXrayPropagator.getInstance();
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.contrib.awsxray.propagator.internal;
7+
8+
import io.opentelemetry.context.propagation.TextMapPropagator;
9+
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayLambdaPropagator;
10+
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider;
11+
import io.opentelemetry.sdk.autoconfigure.spi.internal.StructuredConfigProperties;
12+
13+
public class AwsXrayLambdaComponentProvider implements ComponentProvider<TextMapPropagator> {
14+
@Override
15+
public Class<TextMapPropagator> getType() {
16+
return TextMapPropagator.class;
17+
}
18+
19+
@Override
20+
public String getName() {
21+
return "xray-lambda";
22+
}
23+
24+
@Override
25+
public TextMapPropagator create(StructuredConfigProperties config) {
26+
return AwsXrayLambdaPropagator.getInstance();
27+
}
28+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package io.opentelemetry.contrib.awsxray.propagator;
6+
package io.opentelemetry.contrib.awsxray.propagator.internal;
77

88
import io.opentelemetry.context.propagation.TextMapPropagator;
9+
import io.opentelemetry.contrib.awsxray.propagator.AwsXrayLambdaPropagator;
910
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
1011
import io.opentelemetry.sdk.autoconfigure.spi.ConfigurablePropagatorProvider;
1112

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
io.opentelemetry.contrib.awsxray.propagator.AwsConfigurablePropagator
1+
io.opentelemetry.contrib.awsxray.propagator.internal.AwsConfigurablePropagator
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
io.opentelemetry.contrib.awsxray.propagator.internal.AwsXrayComponentProvider
2+
io.opentelemetry.contrib.awsxray.propagator.internal.AwsXrayLambdaComponentProvider

0 commit comments

Comments
 (0)