Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
b108750
Add OTel span support
sdaubin May 3, 2024
53a0a96
Documentation
sdaubin May 3, 2024
50ada7a
Add static constructor
sdaubin May 3, 2024
fe873d7
Add test showing the SpanBuilder.setParent doesn't link async work
sdaubin May 3, 2024
8faee60
Implement more of the OTel API for spans
sdaubin May 6, 2024
583a36a
Add a switch to disable custom otel span builder
sdaubin May 7, 2024
bcb9146
Merge remote-tracking branch 'origin' into saxon/replace-otel-spans2
sdaubin May 7, 2024
c7bdc0a
Fix test
sdaubin May 8, 2024
4563453
Log if `otel.exporter.otlp.endpoint` is set
sdaubin May 8, 2024
224947c
Update DefaultTracerTest.java
sdaubin May 8, 2024
6041d13
Allow individual opentelemetry instrumentation scopes to be disabled
sdaubin May 10, 2024
a9029cc
Try to fix test
sdaubin May 10, 2024
67efb93
Use OpenTelemetry no op Span instance
sdaubin May 16, 2024
509ce8a
Fix sql obfuscation of QueryConverter used by otel spans
sdaubin May 21, 2024
4911fc1
Add another external span test
sdaubin May 21, 2024
ba4835a
Merge branch 'main' into saxon/replace-otel-spans2
jasonjkeller Jun 28, 2024
972a16c
Add copyright header and formatting
jasonjkeller Jul 1, 2024
12e2ef4
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Sep 23, 2024
f99b9ed
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Oct 7, 2024
35c91f8
Add some comments
jasonjkeller Oct 29, 2024
0750c0b
Merge main
jasonjkeller Nov 14, 2024
c308a60
Add readme for OTel functionality
jasonjkeller Dec 2, 2024
61bf958
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Jan 6, 2025
34ac22a
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Mar 10, 2025
df75b02
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Mar 13, 2025
36a4c8f
Additional unit tests
jtduffy Mar 28, 2025
9a1c6a4
Fix broken trace propagation with w3c headers
jasonjkeller Apr 4, 2025
a7bd252
Cleanup
jasonjkeller Apr 4, 2025
6199e9a
Merge pull request #2299 from newrelic/fix-broken-trace-propagation
jasonjkeller Apr 7, 2025
1eafb84
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Apr 7, 2025
d7ab6b6
Add assertions on OTel span data
jasonjkeller Apr 28, 2025
f15b8ee
Merge pull request #2338 from newrelic/otel-cross-agent-tests
jasonjkeller Apr 28, 2025
01ccb3e
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Jul 17, 2025
f685382
initial test of excluding meters by name
kanderson250 Aug 2, 2025
9190f61
Initial prototype of OTel Logs API support
jasonjkeller Aug 7, 2025
66c895c
Add basic configuration for otel meter excludes
kanderson250 Aug 12, 2025
25ef8d0
Add otel config class
kanderson250 Aug 12, 2025
38cb41a
Add tests for Logs API
jasonjkeller Aug 12, 2025
8f4c713
Some cleanup
jasonjkeller Aug 13, 2025
ca00627
Add meter customizer to working branch
kanderson250 Aug 14, 2025
02fa4b3
Merge pull request #2452 from newrelic/otel-logs-api
jasonjkeller Aug 15, 2025
87347d5
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Aug 15, 2025
b67d941
Fix AutoConfiguredOpenTelemetrySdkBuilder
jasonjkeller Aug 15, 2025
6cde0e3
Flesh out meter excludes tests
kanderson250 Aug 15, 2025
b23727d
Merge branch 'saxon/replace-otel-spans2' into otel-metric-excludes
kanderson250 Aug 15, 2025
b02023b
Add otel config tests and some naming
kanderson250 Aug 18, 2025
b3fcb92
Fix NRLogRecordTest
jasonjkeller Aug 18, 2025
f218a8a
Fix SpanTest
jasonjkeller Aug 18, 2025
49bff67
Merge pull request #2459 from newrelic/otel-metric-excludes
kanderson250 Aug 18, 2025
0794620
OTel attribute mapper impl
jtduffy Aug 19, 2025
59a7e6e
Update JSON
jtduffy Aug 19, 2025
7d77e68
Update config in README
jasonjkeller Aug 19, 2025
68b8eb4
Merge pull request #2461 from newrelic/attribute-mapper
jtduffy Aug 20, 2025
72f970f
WIP
jtduffy Aug 20, 2025
35acb9c
Updated JSON file and attribute types
jtduffy Aug 26, 2025
d28ebb7
Some cleanup around attributes
jasonjkeller Aug 28, 2025
146d968
Merge branch 'saxon/replace-otel-spans2' of github.com:newrelic/newre…
jasonjkeller Aug 28, 2025
15b3292
WIP
jtduffy Sep 5, 2025
13987d5
Update logic for getting the timestamp and log level
jasonjkeller Sep 8, 2025
f2f03b1
Configure OTel SDK to only export metrics via OTLP
jasonjkeller Sep 19, 2025
0d28dd4
Add supportability metrics when logs, traces, or metrics are enabled
jasonjkeller Sep 22, 2025
b95802c
Formatting
jasonjkeller Sep 22, 2025
3b26999
Merge pull request #2477 from newrelic/attributes-json
jtduffy Sep 26, 2025
26e6bb5
Add LogDuplicationChecker
jasonjkeller Oct 1, 2025
cc1223f
Merge branch 'saxon/replace-otel-spans2' of github.com:newrelic/newre…
jasonjkeller Oct 1, 2025
e5dcce7
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Oct 1, 2025
9483d56
Get thread attributes from context data if present
jasonjkeller Oct 3, 2025
24125d9
Update tests and test resource
jtduffy Oct 6, 2025
6190d9d
JSON load fix
jtduffy Oct 23, 2025
c8c10ff
Merge pull request #2558 from newrelic/json-fix
jasonjkeller Nov 4, 2025
294ab88
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Nov 4, 2025
5767c5e
Refactor opentelemetry config to match agent specs
jasonjkeller Nov 13, 2025
f222d8a
Update documentation
jasonjkeller Nov 14, 2025
6c52c8e
Update some Javadoc comments
jasonjkeller Nov 14, 2025
1f06314
Fix typo in readme
jasonjkeller Nov 17, 2025
18787ee
Merge pull request #2584 from newrelic/refactor-hybrid-agent-config
jasonjkeller Nov 17, 2025
0983ef1
Fix a couple of tests
jasonjkeller Nov 17, 2025
fb74d68
Merge branch 'main' of github.com:newrelic/newrelic-java-agent into s…
jasonjkeller Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

package com.newrelic.agent.bridge;

import com.newrelic.api.agent.Token;

import java.lang.reflect.InvocationHandler;


Expand All @@ -19,10 +21,19 @@ public interface ExitTracer extends InvocationHandler, TracedMethod {
*/
void finish(int opcode, Object returnValue);

default void finish() {
// 177 is Opcodes.RETURN
finish(177, null);
}

/**
* Called when a method invocation throws an exception.
*
* @param throwable
*/
void finish(Throwable throwable);

default Token getToken() {
return NoOpToken.INSTANCE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import com.newrelic.api.agent.NewRelic;
import com.newrelic.api.agent.Token;
import com.newrelic.api.agent.Trace;

public interface Instrumentation {

Expand Down Expand Up @@ -59,6 +58,10 @@ ExitTracer createTracer(Object invocationTarget, int signatureId, boolean dispat

ExitTracer createScalaTxnTracer();

default ExitTracer createTracer(String metricName, int flags) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The createSegment API still generates an asynchronous tracer, which is not what we want. And from the bridge there's no easy way to register a signature to get a signatureId. This was the easiest way to get a normal, synchronous tracer.

return null;
}

/**
* Returns the current transaction. This should not be called directly - instead use {@link Agent#getTransaction()}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
*/
public interface TracedMethod extends com.newrelic.api.agent.TracedMethod {

default String getTraceId() {
return "0000000000000000";
}
default String getSpanId() {
return "0000000000000000";
}
/**
* Returns the parent of this traced method, or null if this is the root tracer.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
*
* * Copyright 2024 New Relic Corporation. All rights reserved.
* * SPDX-License-Identifier: Apache-2.0
*
*/

package com.newrelic.agent.bridge.datastore;

import com.newrelic.api.agent.QueryConverter;

public final class SqlQueryConverter implements QueryConverter<String> {
public static final QueryConverter<String> INSTANCE = new SqlQueryConverter();

private SqlQueryConverter() {
}

@Override
public String toRawQueryString(String rawQuery) {
return rawQuery;
}

@Override
public String toObfuscatedQueryString(String rawQuery) {
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import java.util.Map;

public interface SpanEvent {
String getGuid();

String getName();

float duration();
Expand All @@ -33,4 +35,6 @@ public interface SpanEvent {
String getStatusText();

Map<String, Object> getAgentAttributes();

Map<String, Object> getUserAttributes();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ public SpanEventImpl(com.newrelic.agent.model.SpanEvent spanEvent) {
this.spanEvent = spanEvent;
}

/**
* This method is just to facilitate testing
*
* @return String representing Span ID
*/
@Override
public String getGuid() {
return spanEvent.getGuid();
}

@Override
public String getName() {
return spanEvent.getName();
Expand Down Expand Up @@ -74,9 +84,13 @@ public String getStatusText() {
return (String) spanEvent.getAgentAttributes().get("http.statusText");
}


@Override
public Map<String, Object> getAgentAttributes() {
return spanEvent.getAgentAttributes();
}

@Override
public Map<String, Object> getUserAttributes() {
return spanEvent.getUserAttributesCopy();
}
}
Loading
Loading