Skip to content

Commit 4f72303

Browse files
committed
Merge branch 'main' into integration-test-hadoop
2 parents f7fe951 + 6069c1d commit 4f72303

File tree

36 files changed

+375
-189
lines changed

36 files changed

+375
-189
lines changed

.github/component_owners.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ components:
1919
aws-xray-propagator:
2020
- wangzlei
2121
- srprash
22-
baggage-procesor:
22+
baggage-processor:
2323
- mikegoldsmith
2424
- zeitlinger
2525
compressors:

.github/config/markdown-link-check-config.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/scripts/markdown-link-check-with-retry.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/reusable-markdown-link-check.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v4
1111

12-
- name: Install markdown-link-check
13-
# TODO(jack-berg): use latest when config file reading bug is fixed: https://github.com/tcort/markdown-link-check/issues/246
14-
run: npm install -g [email protected]
15-
16-
- name: Run markdown-link-check
17-
run: |
18-
find . -type f \
19-
-name '*.md' \
20-
-not -path './CHANGELOG.md' \
21-
| xargs .github/scripts/markdown-link-check-with-retry.sh
12+
- uses: lycheeverse/lychee-action@v2
13+
with:
14+
# remove version after next release of lychee-action
15+
lycheeVersion: latest
16+
# excluding links to pull requests and issues is done for performance
17+
args: >
18+
--include-fragments
19+
--exclude "^https://github.com/open-telemetry/opentelemetry-java-contrib/(issue|pull)/\\d+$"
20+
--max-retries 6
21+
.

aws-xray/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies {
1414

1515
implementation("com.squareup.okhttp3:okhttp")
1616
implementation("io.opentelemetry.semconv:opentelemetry-semconv")
17-
implementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating")
17+
testImplementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating")
1818

1919
annotationProcessor("com.google.auto.service:auto-service")
2020
testImplementation("com.google.auto.service:auto-service")

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

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,6 @@
1616
import static io.opentelemetry.contrib.awsxray.AwsAttributeKeys.AWS_STREAM_NAME;
1717
import static io.opentelemetry.contrib.awsxray.AwsAttributeKeys.AWS_TABLE_NAME;
1818
import static io.opentelemetry.semconv.ServiceAttributes.SERVICE_NAME;
19-
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_OPERATION;
20-
import static io.opentelemetry.semconv.incubating.DbIncubatingAttributes.DB_SYSTEM;
21-
import static io.opentelemetry.semconv.incubating.FaasIncubatingAttributes.FAAS_INVOKED_NAME;
22-
import static io.opentelemetry.semconv.incubating.FaasIncubatingAttributes.FAAS_TRIGGER;
23-
import static io.opentelemetry.semconv.incubating.GraphqlIncubatingAttributes.GRAPHQL_OPERATION_TYPE;
24-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_METHOD;
25-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_TARGET;
26-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_URL;
27-
import static io.opentelemetry.semconv.incubating.MessagingIncubatingAttributes.MESSAGING_OPERATION;
28-
import static io.opentelemetry.semconv.incubating.MessagingIncubatingAttributes.MESSAGING_SYSTEM;
29-
import static io.opentelemetry.semconv.incubating.NetIncubatingAttributes.NET_PEER_NAME;
30-
import static io.opentelemetry.semconv.incubating.NetIncubatingAttributes.NET_PEER_PORT;
31-
import static io.opentelemetry.semconv.incubating.NetIncubatingAttributes.NET_SOCK_PEER_ADDR;
32-
import static io.opentelemetry.semconv.incubating.NetIncubatingAttributes.NET_SOCK_PEER_PORT;
33-
import static io.opentelemetry.semconv.incubating.PeerIncubatingAttributes.PEER_SERVICE;
34-
import static io.opentelemetry.semconv.incubating.RpcIncubatingAttributes.RPC_METHOD;
35-
import static io.opentelemetry.semconv.incubating.RpcIncubatingAttributes.RPC_SERVICE;
3619

3720
import io.opentelemetry.api.common.AttributeKey;
3821
import io.opentelemetry.api.common.Attributes;
@@ -41,7 +24,6 @@
4124
import io.opentelemetry.sdk.resources.Resource;
4225
import io.opentelemetry.sdk.trace.data.SpanData;
4326
import io.opentelemetry.semconv.ServiceAttributes;
44-
import io.opentelemetry.semconv.incubating.GraphqlIncubatingAttributes;
4527
import java.net.MalformedURLException;
4628
import java.net.URL;
4729
import java.util.Optional;
@@ -57,7 +39,6 @@
5739
* represent "incoming" traffic, {@link SpanKind#CLIENT} and {@link SpanKind#PRODUCER} spans
5840
* represent "outgoing" traffic, and {@link SpanKind#INTERNAL} spans are ignored.
5941
*/
60-
@SuppressWarnings("deprecation") // uses deprecated semantic conventions
6142
final class AwsMetricAttributeGenerator implements MetricAttributeGenerator {
6243

6344
private static final Logger logger =
@@ -72,6 +53,38 @@ final class AwsMetricAttributeGenerator implements MetricAttributeGenerator {
7253
private static final String UNKNOWN_REMOTE_SERVICE = "UnknownRemoteService";
7354
private static final String UNKNOWN_REMOTE_OPERATION = "UnknownRemoteOperation";
7455

56+
// copied from DbIncubatingAttributes
57+
private static final AttributeKey<String> DB_OPERATION = AttributeKey.stringKey("db.operation");
58+
private static final AttributeKey<String> DB_SYSTEM = AttributeKey.stringKey("db.system");
59+
// copied from FaasIncubatingAttributes
60+
private static final AttributeKey<String> FAAS_INVOKED_NAME =
61+
AttributeKey.stringKey("faas.invoked_name");
62+
private static final AttributeKey<String> FAAS_TRIGGER = AttributeKey.stringKey("faas.trigger");
63+
// copied from GraphqlIncubatingAttributes
64+
private static final AttributeKey<String> GRAPHQL_OPERATION_TYPE =
65+
AttributeKey.stringKey("graphql.operation.type");
66+
// copied from HttpIncubatingAttributes
67+
private static final AttributeKey<String> HTTP_METHOD = AttributeKey.stringKey("http.method");
68+
private static final AttributeKey<String> HTTP_TARGET = AttributeKey.stringKey("http.target");
69+
private static final AttributeKey<String> HTTP_URL = AttributeKey.stringKey("http.url");
70+
// copied from MessagingIncubatingAttributes
71+
private static final AttributeKey<String> MESSAGING_OPERATION =
72+
AttributeKey.stringKey("messaging.operation");
73+
private static final AttributeKey<String> MESSAGING_SYSTEM =
74+
AttributeKey.stringKey("messaging.system");
75+
// copied from NetIncubatingAttributes
76+
private static final AttributeKey<String> NET_PEER_NAME = AttributeKey.stringKey("net.peer.name");
77+
private static final AttributeKey<Long> NET_PEER_PORT = AttributeKey.longKey("net.peer.port");
78+
private static final AttributeKey<String> NET_SOCK_PEER_ADDR =
79+
AttributeKey.stringKey("net.sock.peer.addr");
80+
private static final AttributeKey<Long> NET_SOCK_PEER_PORT =
81+
AttributeKey.longKey("net.sock.peer.port");
82+
// copied from PeerIncubatingAttributes
83+
private static final AttributeKey<String> PEER_SERVICE = AttributeKey.stringKey("peer.service");
84+
// copied from RpcIncubatingAttributes
85+
private static final AttributeKey<String> RPC_METHOD = AttributeKey.stringKey("rpc.method");
86+
private static final AttributeKey<String> RPC_SERVICE = AttributeKey.stringKey("rpc.service");
87+
7588
@Override
7689
public Attributes generateMetricAttributesFromSpan(SpanData span, Resource resource) {
7790
AttributesBuilder builder = Attributes.builder();
@@ -196,8 +209,8 @@ private static void setEgressOperation(SpanData span, AttributesBuilder builder)
196209
* <li>DB
197210
* <li>FAAS
198211
* <li>Messaging
199-
* <li>GraphQL - Special case, if {@link GraphqlIncubatingAttributes#GRAPHQL_OPERATION_TYPE} is
200-
* present, we use it for RemoteOperation and set RemoteService to {@link #GRAPHQL}.
212+
* <li>GraphQL - Special case, if {@link #GRAPHQL_OPERATION_TYPE} is present, we use it for
213+
* RemoteOperation and set RemoteService to {@link #GRAPHQL}.
201214
* </ul>
202215
*
203216
* <p>In each case, these span attributes were selected from the OpenTelemetry trace semantic

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
package io.opentelemetry.contrib.awsxray;
77

8-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_STATUS_CODE;
9-
8+
import io.opentelemetry.api.common.AttributeKey;
109
import io.opentelemetry.api.common.Attributes;
1110
import io.opentelemetry.api.metrics.DoubleHistogram;
1211
import io.opentelemetry.api.metrics.LongCounter;
@@ -39,9 +38,11 @@
3938
* AlwaysRecordSampler}, which will result in 100% of spans being sent to the processor.
4039
*/
4140
@Immutable
42-
@SuppressWarnings("deprecation") // uses deprecated semantic conventions
4341
public final class AwsSpanMetricsProcessor implements SpanProcessor {
4442

43+
private static final AttributeKey<Long> HTTP_STATUS_CODE =
44+
AttributeKey.longKey("http.status_code");
45+
4546
private static final double NANOS_TO_MILLIS = 1_000_000.0;
4647

4748
// Constants for deriving error and fault metrics

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

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
package io.opentelemetry.contrib.awsxray;
77

88
import static io.opentelemetry.semconv.ServiceAttributes.SERVICE_NAME;
9-
import static io.opentelemetry.semconv.incubating.AwsIncubatingAttributes.AWS_ECS_CONTAINER_ARN;
10-
import static io.opentelemetry.semconv.incubating.CloudIncubatingAttributes.CLOUD_PLATFORM;
11-
import static io.opentelemetry.semconv.incubating.CloudIncubatingAttributes.CLOUD_RESOURCE_ID;
12-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_HOST;
13-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_METHOD;
14-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_TARGET;
15-
import static io.opentelemetry.semconv.incubating.HttpIncubatingAttributes.HTTP_URL;
16-
import static io.opentelemetry.semconv.incubating.NetIncubatingAttributes.NET_HOST_NAME;
179

1810
import io.opentelemetry.api.common.AttributeKey;
1911
import io.opentelemetry.api.common.Attributes;
@@ -27,7 +19,6 @@
2719
import io.opentelemetry.sdk.trace.samplers.Sampler;
2820
import io.opentelemetry.sdk.trace.samplers.SamplingDecision;
2921
import io.opentelemetry.sdk.trace.samplers.SamplingResult;
30-
import io.opentelemetry.semconv.incubating.CloudIncubatingAttributes;
3122
import java.time.Duration;
3223
import java.util.Collections;
3324
import java.util.Date;
@@ -42,22 +33,37 @@
4233

4334
final class SamplingRuleApplier {
4435

36+
// copied from AwsIncubatingAttributes
37+
private static final AttributeKey<String> AWS_ECS_CONTAINER_ARN =
38+
AttributeKey.stringKey("aws.ecs.container.arn");
39+
// copied from CloudIncubatingAttributes
40+
private static final AttributeKey<String> CLOUD_PLATFORM =
41+
AttributeKey.stringKey("cloud.platform");
42+
private static final AttributeKey<String> CLOUD_RESOURCE_ID =
43+
AttributeKey.stringKey("cloud.resource_id");
44+
// copied from CloudIncubatingAttributes.CloudPlatformIncubatingValues
45+
public static final String AWS_EC2 = "aws_ec2";
46+
public static final String AWS_ECS = "aws_ecs";
47+
public static final String AWS_EKS = "aws_eks";
48+
public static final String AWS_LAMBDA = "aws_lambda";
49+
public static final String AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk";
50+
// copied from HttpIncubatingAttributes
51+
private static final AttributeKey<String> HTTP_HOST = AttributeKey.stringKey("http.host");
52+
private static final AttributeKey<String> HTTP_METHOD = AttributeKey.stringKey("http.method");
53+
private static final AttributeKey<String> HTTP_TARGET = AttributeKey.stringKey("http.target");
54+
private static final AttributeKey<String> HTTP_URL = AttributeKey.stringKey("http.url");
55+
// copied from NetIncubatingAttributes
56+
private static final AttributeKey<String> NET_HOST_NAME = AttributeKey.stringKey("net.host.name");
57+
4558
private static final Map<String, String> XRAY_CLOUD_PLATFORM;
4659

4760
static {
4861
Map<String, String> xrayCloudPlatform = new HashMap<>();
49-
xrayCloudPlatform.put(
50-
CloudIncubatingAttributes.CloudPlatformIncubatingValues.AWS_EC2, "AWS::EC2::Instance");
51-
xrayCloudPlatform.put(
52-
CloudIncubatingAttributes.CloudPlatformIncubatingValues.AWS_ECS, "AWS::ECS::Container");
53-
xrayCloudPlatform.put(
54-
CloudIncubatingAttributes.CloudPlatformIncubatingValues.AWS_EKS, "AWS::EKS::Container");
55-
xrayCloudPlatform.put(
56-
CloudIncubatingAttributes.CloudPlatformIncubatingValues.AWS_ELASTIC_BEANSTALK,
57-
"AWS::ElasticBeanstalk::Environment");
58-
xrayCloudPlatform.put(
59-
CloudIncubatingAttributes.CloudPlatformIncubatingValues.AWS_LAMBDA,
60-
"AWS::Lambda::Function");
62+
xrayCloudPlatform.put(AWS_EC2, "AWS::EC2::Instance");
63+
xrayCloudPlatform.put(AWS_ECS, "AWS::ECS::Container");
64+
xrayCloudPlatform.put(AWS_EKS, "AWS::EKS::Container");
65+
xrayCloudPlatform.put(AWS_ELASTIC_BEANSTALK, "AWS::ElasticBeanstalk::Environment");
66+
xrayCloudPlatform.put(AWS_LAMBDA, "AWS::Lambda::Function");
6167
XRAY_CLOUD_PLATFORM = Collections.unmodifiableMap(xrayCloudPlatform);
6268
}
6369

@@ -348,7 +354,7 @@ private static String getArn(Attributes attributes, Resource resource) {
348354
return arn;
349355
}
350356
String cloudPlatform = resource.getAttributes().get(CLOUD_PLATFORM);
351-
if (CloudIncubatingAttributes.CloudPlatformIncubatingValues.AWS_LAMBDA.equals(cloudPlatform)) {
357+
if (AWS_LAMBDA.equals(cloudPlatform)) {
352358
return getLambdaArn(attributes, resource);
353359
}
354360
return null;

baggage-processor/README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# OpenTelemetry Baggage Span Processor
1+
# OpenTelemetry Baggage Span and Log Record Processor
22

3-
The `BaggageSpanProcessor` and `BaggageLogRecordPRocessor` read entries stored in Baggage from the
3+
The `BaggageSpanProcessor` and `BaggageLogRecordProcessor` read entries stored in Baggage from the
44
parent context and adds the baggage keys and values to the `Span`, respectively `LogRecord`, as
55
attributes on start, respectively emit.
66

@@ -15,6 +15,18 @@ Do not put sensitive information in Baggage.
1515

1616
## Usage
1717

18+
### Usage with SDK auto-configuration
19+
20+
If you are using the OpenTelemetry SDK auto-configuration, you can add the span and log baggage
21+
processors through configuration.
22+
23+
| Property | Description |
24+
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
25+
| `otel.java.experimental.span-attributes.copy-from-baggage.include` | Add baggage entries as span attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |
26+
| `otel.java.experimental.log-attributes.copy-from-baggage.include` | Add baggage entries as log attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |
27+
28+
### Usage through programmatic activation
29+
1830
Add the span and log processor when configuring the tracer and logger providers.
1931

2032
To configure the span and log processors to copy all baggage entries during configuration:
@@ -49,16 +61,6 @@ new BaggageSpanProcessor(baggageKey -> pattern.matcher(baggageKey).matches());
4961
new BaggageLogRecordProcessor(baggageKey -> pattern.matcher(baggageKey).matches());
5062
```
5163

52-
## Usage with SDK auto-configuration
53-
54-
If you are using the OpenTelemetry SDK auto-configuration, you can add the span and log baggage
55-
processors through configuration.
56-
57-
| Property | Description |
58-
|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
59-
| `otel.java.experimental.span-attributes.copy-from-baggage.include` | Add baggage entries as span attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |
60-
| `otel.java.experimental.log-attributes.copy-from-baggage.include` | Add baggage entries as log attributes, e.g. `key1,key2` or `*` to add all baggage items as keys. |
61-
6264
## Component owners
6365

6466
- [Mike Golsmith](https://github.com/MikeGoldsmith), Honeycomb

compressors/compressor-zstd/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ otelJava.moduleName.set("io.opentelemetry.contrib.compressor.zstd")
99
dependencies {
1010
api("io.opentelemetry:opentelemetry-exporter-common")
1111

12-
implementation("com.github.luben:zstd-jni:1.5.6-8")
12+
implementation("com.github.luben:zstd-jni:1.5.6-9")
1313

1414
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
1515
testImplementation("io.opentelemetry:opentelemetry-exporter-otlp")

0 commit comments

Comments
 (0)