Skip to content

Commit 01ccb3e

Browse files
committed
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into saxon/replace-otel-spans2
2 parents f15b8ee + e97b02d commit 01ccb3e

File tree

174 files changed

+7609
-399
lines changed

Some content is hidden

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

174 files changed

+7609
-399
lines changed

.github/workflows/GHA-Scala-Instrumentation-Tests.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ jobs:
5555
- name: Build newrelicJar
5656
run: ./gradlew $GRADLE_OPTIONS clean jar --parallel
5757

58+
- name: Fix the /etc/hosts/ file (since it's been messed up before)
59+
run: |
60+
echo "Old /etc/hosts/ file"
61+
cat /etc/hosts
62+
echo "Overwriting /etc/hosts file"
63+
sudo echo "127.0.0.1 localhost $HOSTNAME" | sudo tee /etc/hosts
64+
echo "New /etc/hosts file"
65+
cat /etc/hosts
66+
5867
- name: Run instrumentation tests for Java ${{ matrix.java-version }} and scala ${{ matrix.scala }} (attempt 1)
5968
id: run_tests_1
6069
continue-on-error: true

.github/workflows/GHA-Spotbugs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
jobs:
1818
spotbugs:
19-
timeout-minutes: 15
19+
timeout-minutes: 30
2020
runs-on: ubuntu-24.04
2121
steps:
2222
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # pin@v4

.github/workflows/Release-CopyToS3-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
- name: Run script
2828
env:
2929
RUNNING_ON_GHA: 'true'
30-
run: ./automation/release/copy-to-s3.sh staging ${{ inputs.version_number }} default
30+
run: ./automation/release/copy-to-s3-prod.sh ${{ inputs.version_number }} default

.github/workflows/Release-CopyToS3-staging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Release - Copy to S3 (Staging)
33
on:
44
workflow_dispatch:
55
inputs:
6-
repo_name:
6+
deployment_id:
77
required: true
88
type: string
9-
description: 'The sonatype repo name. Eg. comnewrelic-1234'
9+
description: 'The sonatype deployment id. Eg. x9a06328-cc91-24a5-fg13-7xa1d3669d842k'
1010
version_number:
1111
required: true
1212
type: string
@@ -31,4 +31,4 @@ jobs:
3131
- name: Run script
3232
env:
3333
RUNNING_ON_GHA: 'true'
34-
run: ./automation/release/copy-to-s3.sh ${{ inputs.repo_name }} ${{ inputs.version_number }} staging
34+
run: ./automation/release/copy-to-s3.sh ${{ inputs.deployment_id }} ${{ inputs.version_number }} staging ${{ secrets.SONATYPE_USERNAME }} ${{ secrets.SONATYPE_PASSWORD }}

.github/workflows/Test-AITs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,15 @@ jobs:
310310
TEST_NAME=$(echo ${{ matrix.tests }} | sed 's|/|-|g')
311311
echo "TEST_NAME="${TEST_NAME}"" >> $GITHUB_ENV
312312
313+
- name: Fix the /etc/hosts/ file (since it's been messed up before)
314+
run: |
315+
echo "Old /etc/hosts/ file"
316+
cat /etc/hosts
317+
echo "Overwriting /etc/hosts file"
318+
sudo echo "127.0.0.1 localhost $HOSTNAME" | sudo tee /etc/hosts
319+
echo "New /etc/hosts file"
320+
cat /etc/hosts
321+
313322
## WE LOSE THE VIRTUAL ENVIRONMENT ONCE WE LEAVE THE STEP
314323
## TODO: This should really be a custom action, too many commands
315324
- name: Create virtualenv and run ${{ matrix.tests }}

.github/workflows/TestSuite-PR.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ jobs:
5757
with:
5858
agent-ref: ${{ inputs.agent-ref || github.sha || 'main' }}
5959
secrets: inherit
60+
61+
verify-unshadowed-jars:
62+
uses: ./.github/workflows/VerifyUnshadowedJars.yml
63+
with:
64+
agent-ref: ${{ inputs.agent-ref || github.sha || 'main' }}
65+
secrets: inherit

.github/workflows/TestSuite-Release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
agent-ref: ${{ inputs.agent-ref || github.sha || 'main' }}
5656
secrets: inherit
5757

58+
verify-unshadowed-jars:
59+
uses: ./.github/workflows/VerifyUnshadowedJars.yml
60+
with:
61+
agent-ref: ${{ inputs.agent-ref || github.sha || 'main' }}
62+
secrets: inherit
63+
5864
verify-instrumentation:
5965
uses: ./.github/workflows/VerifyInstrumentation.yml
6066
with:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Verify Unshadowed Jars
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
agent-ref:
6+
required: true
7+
default: main
8+
type: string
9+
description: 'The ref (branch, SHA, tag?) to run the verification on'
10+
workflow_call:
11+
inputs:
12+
agent-ref:
13+
description: 'The ref (branch, SHA, tag?) to run the tests on'
14+
required: false
15+
default: 'main'
16+
type: string
17+
18+
jobs:
19+
verify-shadowed-jars:
20+
name: Verify Shadowed Jars
21+
runs-on: ubuntu-24.04
22+
env:
23+
AWS_KEY: ${{ secrets.aws-secret-access-key }}
24+
steps:
25+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # pin@v4
26+
with:
27+
ref: ${{ inputs.agent-ref }}
28+
29+
- name: Configure AWS Credentials
30+
if: ${{ env.AWS_KEY != '' }}
31+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # pin@v4
32+
with:
33+
aws-access-key-id: ${{ secrets.aws-access-key-id }}
34+
aws-secret-access-key: ${{ secrets.aws-secret-access-key }}
35+
aws-region: us-east-2
36+
37+
- name: Setup environment
38+
uses: ./.github/actions/setup-environment
39+
40+
- name: Build agent
41+
run: ./gradlew $GRADLE_OPTIONS clean jar
42+
43+
- name: Run script
44+
env:
45+
RUNNING_ON_GHA: 'true'
46+
run: ./automation/verify-unshadowed-jars.sh

.github/workflows/publish_release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,28 @@ jobs:
5353
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
5454
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
5555
run: ./gradlew $GRADLE_OPTIONS :newrelic-opentelemetry-agent-extension:publish -Prelease=true
56+
57+
- name: Upload staged artifacts to Central Sonatype
58+
env:
59+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
60+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
61+
run: |
62+
# token is a b64-encoded string of username:password, used in auth header of API call
63+
SONATYPE_TOKEN=$(printf "$SONATYPE_USERNAME:$SONATYPE_PASSWORD" | base64)
64+
PUBLISH_NAMESPACE="com.newrelic"
65+
# makes a curl request to ossrh-staging-api to upload everything to Central Sonatype
66+
echo "Uploading artifacts from OSSRH-Staging to Central Sonatype..."
67+
# captures response code and body of curl request
68+
RESPONSE=$(curl -s -w "%{http_code}" -o response_body.txt -X POST \
69+
-H "Authorization: Bearer $SONATYPE_TOKEN" \
70+
"https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/$PUBLISH_NAMESPACE?publishing_type=user_managed")
71+
# job fails if we got anything back but a 200
72+
if [ "$RESPONSE" -ne 200 ]; then
73+
echo "Failed to upload artifacts to Central Sonatype. Response code: $RESPONSE. Response body: "
74+
cat response_body.txt
75+
echo "Visit https://central.sonatype.com/publishing/deployments for more information."
76+
exit 1
77+
else
78+
echo "Artifacts were uploaded successfully to Central Sonatype."
79+
echo "Visit https://central.sonatype.com/publishing/deployments to view your artifacts."
80+
fi

CHANGELOG.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,116 @@ Noteworthy changes to the agent are documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Version 8.22.0
8+
## New features and improvements
9+
10+
* Azure ServiceBus 7.15.0 instrumentation by @jbedell-newrelic in [2384](https://github.com/newrelic/newrelic-java-agent/pull/2384)
11+
* Linking metadata for Azure App services by @jbedell-newrelic in [2399](https://github.com/newrelic/newrelic-java-agent/pull/2399)
12+
* Connection errors now logged at SEVERE by @jtduffy in [2377](https://github.com/newrelic/newrelic-java-agent/pull/2377)
13+
* Log and obfuscate invalid keys added as attributes to logs and events by @jtduffy in [2388](https://github.com/newrelic/newrelic-java-agent/pull/2388)
14+
* Remove MonoFlatMapMain Instrumentation by @deleonenriqueta in [2400](https://github.com/newrelic/newrelic-java-agent/pull/2400)
15+
16+
## Fixes
17+
18+
* Relocate IntelliJ annotations library by @meiao in [2383](https://github.com/newrelic/newrelic-java-agent/pull/2383)
19+
* Support server side sampling_target configuration by @jtduffy in [2386](https://github.com/newrelic/newrelic-java-agent/pull/2386)
20+
21+
## Deprecations
22+
23+
The following instrumentation modules are deprecated and will be removed in the next major release:
24+
25+
- `aws-wrap-0.7.0`
26+
- `java.completable-future-jdk8`
27+
- `play-2.3`
28+
- `netty-3.4`
29+
- `Struts v1`
30+
31+
## Version 8.21.0
32+
## New features and improvements
33+
34+
- Enhances visibility into Reactor `Mono.flatMap` calls in https://github.com/newrelic/newrelic-java-agent/pull/2308
35+
- Adds new instrumentation for Spring-Kafka and distributed tracing when using the core Kafka client library in https://github.com/newrelic/newrelic-java-agent/pull/2312
36+
- Adds `KafkaConsumerConfig` event support for Kafka 3.7+ in https://github.com/newrelic/newrelic-java-agent/pull/2358
37+
38+
## Fixes
39+
40+
- Fixes the `distributed_tracing.sampler` config in https://github.com/newrelic/newrelic-java-agent/pull/2330
41+
- Fixes an Illegal Access Error that can occur when using Scala 2.12 and JDK 11. In cases where Scala 2.12 is not detectable by the agent (we check the system classloader for this - notably, sbt will load Scala classes into custom Scala loaders), there is also a feature flag to manually enable the fix via system property `-Dnewrelic.config.class_transformer.illegal_access_fix=true` in https://github.com/newrelic/newrelic-java-agent/pull/2334
42+
- Fixes a logic error with the `netty.http2.frame_read_listener.start_transaction` configuration for the `netty-4.1.16` instrumentation module in https://github.com/newrelic/newrelic-java-agent/pull/2355
43+
- Adds a restriction on when to add distributed trace headers for SQS messages. This is based on how large the contents of a message is in bytes and the and the size of attributes. Messages with size greater than 251 KB and/or with 9 or more attributes are excluded from getting distributed trace headers added in https://github.com/newrelic/newrelic-java-agent/pull/2353
44+
- Allows the `org.crac` JAR to be shadowed to prevent conflicts with customer environments. by @jbedell-newrelic in https://github.com/newrelic/newrelic-java-agent/pull/2344
45+
- Backports changes made in PR #1927 to prevent `NullPointerExceptions` to older versions of the `vertx-core` instrumentation in https://github.com/newrelic/newrelic-java-agent/pull/2327
46+
- Prevents excessive transaction segments from being created by `HttpUrlConnection` method calls (e.g. `getInputStream`) when they are not associated with an external call. This behavior can be controlled by the following config options: `NEW_RELIC_CLASS_TRANSFORMER_COM_NEWRELIC_INSTRUMENTATION_HTTPURLCONNECTION_VERBOSE=false`, sys prop `-Dnewrelic.config.class_transformer.com.newrelic.instrumentation.httpurlconnection.verbose=false`, or equivalent stanza in `newrelic.yml`. Default setting is `true` (i.e. non-external `getInputStream` and other response handler methods will be reported as before). in https://github.com/newrelic/newrelic-java-agent/pull/2365
47+
48+
## Security
49+
50+
- Upgrades the `com.newrelic.agent.java:infinite-tracing-protobuf` for better security with infinite tracing in https://github.com/newrelic/newrelic-java-agent/pull/2339
51+
- Replaces `snakeyaml` with `com.konloch:safeyaml` to address a security vulnerability in https://github.com/newrelic/newrelic-java-agent/pull/2333
52+
53+
## Deprecations
54+
55+
The following instrumentation modules are deprecated and will be removed in the next major release:
56+
57+
- `aws-wrap-0.7.0`
58+
- `java.completable-future-jdk8`
59+
- `play-2.3`
60+
- `netty-3.4`
61+
- `Struts v1`
62+
63+
## IAST
64+
65+
CSEC Version Update to 1.7.0 in https://github.com/newrelic/newrelic-java-agent/pull/2348
66+
Changelog: https://github.com/newrelic/csec-java-agent/releases/tag/1.7.0
67+
68+
**Full Changelog**: https://github.com/newrelic/newrelic-java-agent/compare/v8.20.0...v8.21.0
69+
70+
## Version 8.20.0
71+
## New features and improvements
72+
73+
- Support for CRaC [2250](https://github.com/newrelic/newrelic-java-agent/pull/2250)
74+
- Support for JDK24 [2284](https://github.com/newrelic/newrelic-java-agent/pull/2284)
75+
- Add sampling options when an inbound traceparent exists [2279](https://github.com/newrelic/newrelic-java-agent/pull/2279)
76+
- These options define how the agent should handle sampling of spans, depending on sampling decisions that were made for their parent span by an upstream entity. The configuration options `remote_parent_sampled` and `remote_parent_not_sampled` specify what to do in the case the parent span was sampled or not sampled, respectively. See the [documentation](https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-config-file/#dt-sampler-remote-parent-sampled) for full configuration details.
77+
- Support for Undertow as a stand-alone module [2269](https://github.com/newrelic/newrelic-java-agent/pull/2269)
78+
- This instrumentation is disabled by default to avoid conflicts with existing Wildfly instrumentation. To enable this instrumentation for stand-alone Undertow server apps, use the configuration setting:
79+
80+
```yaml
81+
class_transformer:
82+
com.newrelic.instrumentation.undertow-server-1.1.0:
83+
enabled: true
84+
```
85+
86+
- Support for Couchbase Client [2203](https://github.com/newrelic/newrelic-java-agent/pull/2303)
87+
- If the [Couchbase Client Experimental Module](https://github.com/newrelic-experimental/newrelic-java-couchbase) is currently in use, remove it from your extensions directory before upgrading to this version of the Java Agent.
88+
89+
## Fixes
90+
91+
- Fix netty 'Unknown' transactions [2274](https://github.com/newrelic/newrelic-java-agent/pull/2274)
92+
- This fix moves previous netty instrumentation changes behind a feature flag, which provides additional visibility in some cases involving HTTP2 transactions. To reenable this granularity (at the possible cost of seeing ‘Unknown’ transactions), use the config setting:
93+
94+
```yaml
95+
netty:
96+
http2:
97+
frame_read_listener:
98+
start_transaction: true
99+
```
100+
101+
- Refactor AWS docker id fetch to use 5s timeout [2275](https://github.com/newrelic/newrelic-java-agent/pull/2275)
102+
- Feature flag to apply Kotlin `ArrayIndexOutOfBoundsException` fix to all methods [2307](https://github.com/newrelic/newrelic-java-agent/pull/2307 )
103+
- This fix addresses errors that may be seen when running the Java Agent in an environment where Kotlin suspends functions are used. To use this fix, set the system property `-Dnewrelic.config.class_transformer.clear_return_stacks=true`
104+
- Prevent cache lock for long DB statement parsing [2294](https://github.com/newrelic/newrelic-java-agent/pull/2294)
105+
- Add config to specify whether java.sql is loaded by platform classloader [2267](https://github.com/newrelic/newrelic-java-agent/pull/2267)
106+
107+
## Deprecations
108+
109+
The following instrumentation modules are deprecated and will be removed in the next major release:
110+
111+
- `aws-wrap-0.7.0`
112+
- `java.completable-future-jdk8`
113+
- `play-2.3`
114+
- `netty-3.4`
115+
- `Struts v1`
116+
7117
## Version 8.19.0
8118
## New features and improvements
9119

0 commit comments

Comments
 (0)