Skip to content

Commit d0cd9b2

Browse files
authored
Merge branch 'main' into fix-logic-errors
2 parents dec5a55 + 921d53e commit d0cd9b2

File tree

31 files changed

+663
-316
lines changed

31 files changed

+663
-316
lines changed

.github/workflows/documentation-synchronization-audit.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Documentation Synchronization Audit (opentelemetry.io)
22

33
on:
4-
schedule:
5-
- cron: "30 1 * * 1" # every Monday at 1:30 UTC
4+
push:
5+
tags:
6+
- 'v*' # run on release tags
67
workflow_dispatch:
78

89
permissions:

.github/workflows/issue-management-stale-action.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
schedule:
55
# hourly at minute 23
66
- cron: "23 * * * *"
7+
workflow_dispatch:
78

89
permissions:
910
contents: read
@@ -18,19 +19,39 @@ jobs:
1819
steps:
1920
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
2021
with:
21-
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222
days-before-stale: 7
2323
days-before-close: 7
2424
only-labels: "needs author feedback"
2525
stale-issue-label: stale
2626
stale-issue-message: >
27-
This has been automatically marked as stale because it has been marked
28-
as needing author feedback and has not had any activity for 7 days.
29-
It will be closed automatically if there is no response from the author
30-
within 7 additional days from this comment.
27+
This issue has been labeled as stale due to lack of activity and needing author feedback.
28+
It will be automatically closed if there is no further activity over the next 7 days.
3129
stale-pr-label: stale
3230
stale-pr-message: >
33-
This has been automatically marked as stale because it has been marked
34-
as needing author feedback and has not had any activity for 7 days.
35-
It will be closed automatically if there is no response from the author
36-
within 7 additional days from this comment.
31+
This PR has been labeled as stale due to lack of activity and needing author feedback.
32+
It will be automatically closed if there is no further activity over the next 7 days.
33+
34+
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
35+
with:
36+
days-before-stale: 365
37+
days-before-close: 0
38+
close-issue-label: stale
39+
close-issue-message: >
40+
Since there has been no activity on this enhancement for the past year we are closing it to help maintain our backlog.
41+
Anyone who would like to work on it is still welcome to do so, and we can re-open it at that time.
42+
days-before-pr-stale: -1
43+
days-before-pr-close: -1
44+
only-labels: "enhancement"
45+
exempt-issue-labels: "stale" # so that it won't close issues labeled as stale by "needs author feedback"
46+
47+
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
48+
with:
49+
days-before-issue-stale: -1
50+
days-before-issue-close: -1
51+
days-before-pr-stale: 180
52+
days-before-pr-close: 14
53+
stale-pr-label: stale
54+
stale-pr-message: >
55+
This PR has been labeled as stale due to lack of activity.
56+
It will be automatically closed if there is no further activity over the next 14 days.
57+
exempt-draft-pr: false

.github/workflows/overhead-benchmark-daily.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ jobs:
5252
run: rsync -avv benchmark-overhead/results/ gh-pages/benchmark-overhead/results/ && rm -rf benchmark-overhead/results
5353

5454
- name: Use CLA approved bot
55-
run: .github/scripts/use-cla-approved-bot.sh
55+
working-directory: ./gh-pages
56+
run: ../.github/scripts/use-cla-approved-bot.sh
5657

5758
- name: Commit updated results
5859
working-directory: ./gh-pages

instrumentation/aws-lambda/aws-lambda-core-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaInstrumentationModule.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
import com.google.auto.service.AutoService;
1212
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
1313
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
14+
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
1415
import java.util.Arrays;
1516
import java.util.List;
1617
import net.bytebuddy.matcher.ElementMatcher;
1718

1819
@AutoService(InstrumentationModule.class)
19-
public class AwsLambdaInstrumentationModule extends InstrumentationModule {
20+
public class AwsLambdaInstrumentationModule extends InstrumentationModule
21+
implements ExperimentalInstrumentationModule {
2022

2123
public AwsLambdaInstrumentationModule() {
2224
super("aws-lambda-core", "aws-lambda-core-1.0", "aws-lambda");
@@ -39,4 +41,9 @@ public List<TypeInstrumentation> typeInstrumentations() {
3941
new AwsLambdaRequestHandlerInstrumentation(),
4042
new AwsLambdaRequestStreamHandlerInstrumentation());
4143
}
44+
45+
@Override
46+
public boolean isIndyReady() {
47+
return true;
48+
}
4249
}

instrumentation/aws-lambda/aws-lambda-core-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaRequestHandlerInstrumentation.java

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io.opentelemetry.javaagent.extension.instrumentation.TypeTransformer;
2525
import java.util.Collections;
2626
import java.util.concurrent.TimeUnit;
27+
import javax.annotation.Nullable;
2728
import net.bytebuddy.asm.Advice;
2829
import net.bytebuddy.description.type.TypeDescription;
2930
import net.bytebuddy.implementation.bytecode.assign.Assigner.Typing;
@@ -60,38 +61,57 @@ public void transform(TypeTransformer transformer) {
6061
@SuppressWarnings("unused")
6162
public static class HandleRequestAdvice {
6263

63-
@Advice.OnMethodEnter(suppress = Throwable.class)
64-
public static void onEnter(
65-
@Advice.Argument(value = 0, typing = Typing.DYNAMIC) Object arg,
66-
@Advice.Argument(1) Context context,
67-
@Advice.Local("otelInput") AwsLambdaRequest input,
68-
@Advice.Local("otelContext") io.opentelemetry.context.Context otelContext,
69-
@Advice.Local("otelScope") Scope otelScope) {
70-
input = AwsLambdaRequest.create(context, arg, Collections.emptyMap());
71-
io.opentelemetry.context.Context parentContext = functionInstrumenter().extract(input);
64+
public static class AdviceScope {
65+
private final AwsLambdaRequest lambdaRequest;
66+
private final io.opentelemetry.context.Context context;
67+
private final Scope scope;
68+
69+
private AdviceScope(
70+
AwsLambdaRequest lambdaRequest,
71+
io.opentelemetry.context.Context otelContext,
72+
Scope scope) {
73+
this.lambdaRequest = lambdaRequest;
74+
this.context = otelContext;
75+
this.scope = scope;
76+
}
77+
78+
@Nullable
79+
public static AdviceScope start(Object arg, Context context) {
80+
AwsLambdaRequest lambdaRequest =
81+
AwsLambdaRequest.create(context, arg, Collections.emptyMap());
82+
io.opentelemetry.context.Context parentContext =
83+
functionInstrumenter().extract(lambdaRequest);
84+
if (!functionInstrumenter().shouldStart(parentContext, lambdaRequest)) {
85+
return null;
86+
}
87+
88+
io.opentelemetry.context.Context otelContext =
89+
functionInstrumenter().start(parentContext, lambdaRequest);
90+
return new AdviceScope(lambdaRequest, otelContext, otelContext.makeCurrent());
91+
}
7292

73-
if (!functionInstrumenter().shouldStart(parentContext, input)) {
74-
return;
93+
public void end(@Nullable Throwable throwable) {
94+
scope.close();
95+
functionInstrumenter().end(context, lambdaRequest, null, throwable);
96+
OpenTelemetrySdkAccess.forceFlush(flushTimeout().toNanos(), TimeUnit.NANOSECONDS);
7597
}
98+
}
7699

77-
otelContext = functionInstrumenter().start(parentContext, input);
78-
otelScope = otelContext.makeCurrent();
100+
@Advice.OnMethodEnter(suppress = Throwable.class)
101+
public static AdviceScope onEnter(
102+
@Advice.Argument(value = 0, typing = Typing.DYNAMIC) Object arg,
103+
@Advice.Argument(1) Context context) {
104+
return AdviceScope.start(arg, context);
79105
}
80106

81107
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
82108
public static void stopSpan(
83109
@Advice.Argument(value = 0, typing = Typing.DYNAMIC) Object arg,
84110
@Advice.Thrown Throwable throwable,
85-
@Advice.Local("otelInput") AwsLambdaRequest input,
86-
@Advice.Local("otelContext") io.opentelemetry.context.Context functionContext,
87-
@Advice.Local("otelScope") Scope functionScope) {
88-
89-
if (functionScope != null) {
90-
functionScope.close();
91-
functionInstrumenter().end(functionContext, input, null, throwable);
111+
@Advice.Enter @Nullable AdviceScope adviceScope) {
112+
if (adviceScope != null) {
113+
adviceScope.end(throwable);
92114
}
93-
94-
OpenTelemetrySdkAccess.forceFlush(flushTimeout().toNanos(), TimeUnit.NANOSECONDS);
95115
}
96116
}
97117
}

instrumentation/aws-lambda/aws-lambda-core-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awslambdacore/v1_0/AwsLambdaRequestStreamHandlerInstrumentation.java

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.io.InputStream;
2626
import java.util.Collections;
2727
import java.util.concurrent.TimeUnit;
28+
import javax.annotation.Nullable;
2829
import net.bytebuddy.asm.Advice;
2930
import net.bytebuddy.description.type.TypeDescription;
3031
import net.bytebuddy.matcher.ElementMatcher;
@@ -60,38 +61,58 @@ public void transform(TypeTransformer transformer) {
6061
@SuppressWarnings("unused")
6162
public static class HandleRequestAdvice {
6263

63-
@Advice.OnMethodEnter(suppress = Throwable.class)
64-
public static void onEnter(
65-
@Advice.Argument(0) InputStream input,
66-
@Advice.Argument(2) Context context,
67-
@Advice.Local("otelInput") AwsLambdaRequest otelInput,
68-
@Advice.Local("otelContext") io.opentelemetry.context.Context otelContext,
69-
@Advice.Local("otelScope") Scope otelScope) {
70-
71-
otelInput = AwsLambdaRequest.create(context, input, Collections.emptyMap());
72-
io.opentelemetry.context.Context parentContext = functionInstrumenter().extract(otelInput);
73-
74-
if (!functionInstrumenter().shouldStart(parentContext, otelInput)) {
75-
return;
64+
public static class AdviceScope {
65+
private final AwsLambdaRequest lambdaRequest;
66+
private final io.opentelemetry.context.Context context;
67+
private final Scope scope;
68+
69+
private AdviceScope(
70+
AwsLambdaRequest lambdaRequest,
71+
io.opentelemetry.context.Context otelContext,
72+
Scope scope) {
73+
this.lambdaRequest = lambdaRequest;
74+
this.context = otelContext;
75+
this.scope = scope;
76+
}
77+
78+
@Nullable
79+
public static AdviceScope start(InputStream input, Context context) {
80+
AwsLambdaRequest lambdaRequest =
81+
AwsLambdaRequest.create(context, input, Collections.emptyMap());
82+
io.opentelemetry.context.Context parentContext =
83+
functionInstrumenter().extract(lambdaRequest);
84+
85+
if (!functionInstrumenter().shouldStart(parentContext, lambdaRequest)) {
86+
return null;
87+
}
88+
89+
io.opentelemetry.context.Context otelContext =
90+
functionInstrumenter().start(parentContext, lambdaRequest);
91+
return new AdviceScope(lambdaRequest, otelContext, otelContext.makeCurrent());
7692
}
7793

78-
otelContext = functionInstrumenter().start(parentContext, otelInput);
79-
otelScope = otelContext.makeCurrent();
94+
public void end(@Nullable Throwable throwable) {
95+
scope.close();
96+
functionInstrumenter().end(context, lambdaRequest, null, throwable);
97+
98+
OpenTelemetrySdkAccess.forceFlush(flushTimeout().toNanos(), TimeUnit.NANOSECONDS);
99+
}
100+
}
101+
102+
@Nullable
103+
@Advice.OnMethodEnter(suppress = Throwable.class)
104+
public static AdviceScope onEnter(
105+
@Advice.Argument(0) InputStream input, @Advice.Argument(2) Context context) {
106+
return AdviceScope.start(input, context);
80107
}
81108

82109
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
83110
public static void stopSpan(
84-
@Advice.Thrown Throwable throwable,
85-
@Advice.Local("otelInput") AwsLambdaRequest input,
86-
@Advice.Local("otelContext") io.opentelemetry.context.Context functionContext,
87-
@Advice.Local("otelScope") Scope functionScope) {
88-
89-
if (functionScope != null) {
90-
functionScope.close();
91-
functionInstrumenter().end(functionContext, input, null, throwable);
111+
@Advice.Thrown @Nullable Throwable throwable,
112+
@Advice.Enter @Nullable AdviceScope adviceScope) {
113+
if (adviceScope != null) {
114+
adviceScope.end(throwable);
92115
}
93-
94-
OpenTelemetrySdkAccess.forceFlush(flushTimeout().toNanos(), TimeUnit.NANOSECONDS);
95116
}
96117
}
97118
}

instrumentation/aws-lambda/aws-lambda-events-2.2/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/awslambdaevents/v2_2/AwsLambdaInstrumentationModule.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
import com.google.auto.service.AutoService;
1111
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
1212
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
13+
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
1314
import java.util.Arrays;
1415
import java.util.List;
1516
import net.bytebuddy.matcher.ElementMatcher;
1617

1718
@AutoService(InstrumentationModule.class)
18-
public class AwsLambdaInstrumentationModule extends InstrumentationModule {
19+
public class AwsLambdaInstrumentationModule extends InstrumentationModule
20+
implements ExperimentalInstrumentationModule {
1921
public AwsLambdaInstrumentationModule() {
2022
super("aws-lambda-events", "aws-lambda-events-2.2", "aws-lambda");
2123
}
@@ -36,4 +38,9 @@ public List<TypeInstrumentation> typeInstrumentations() {
3638
new AwsLambdaRequestHandlerInstrumentation(),
3739
new AwsLambdaRequestStreamHandlerInstrumentation());
3840
}
41+
42+
@Override
43+
public boolean isIndyReady() {
44+
return true;
45+
}
3946
}

0 commit comments

Comments
 (0)