Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AgentForTestingTest.exportAndRetrieveMetrics() #13414

Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
46e84e5
Add AgentForTestingTest.exportAndRetrieveMetrics()
chlos Feb 27, 2025
b1ebea0
Add missing import
chlos Feb 27, 2025
6ddaffe
Fix format violation
chlos Feb 27, 2025
674d512
fix(deps): update quarkus packages to v3.15.3.1 (patch) (#13413)
renovate[bot] Feb 27, 2025
6951c2b
Redact query string values for http client spans (#13114)
jeanbisutti Feb 27, 2025
2064072
Better benchmark-overhead test logging (#13415)
trask Feb 27, 2025
becacd8
fix(deps): update dependency com.uber.nullaway:nullaway to v0.12.4 (#…
renovate[bot] Feb 28, 2025
24c80ec
fix(deps): update dependency org.codehaus.groovy:groovy-bom to v3.0.2…
renovate[bot] Feb 28, 2025
8c1e4f2
fix(deps): update groovy monorepo to v4.0.26 (patch) (#13421)
renovate[bot] Feb 28, 2025
ffd0b1a
Fix benchmark-overhead compilation (#13418)
trask Feb 28, 2025
10034d8
Add all otel api bridging instrumentations to testing agent (#13423)
laurit Feb 28, 2025
b8a5b50
Merge change log updates from release/v2.13.x (#13426)
otelbot[bot] Mar 1, 2025
9571a98
fix(deps): update dependency com.fasterxml.jackson.core:jackson-datab…
renovate[bot] Mar 1, 2025
98ef9a0
fix(deps): update dependency com.fasterxml.jackson:jackson-bom to v2.…
renovate[bot] Mar 1, 2025
d9356df
Fix adding logback mdc appender in spring starter (#13391)
laurit Mar 1, 2025
373bf80
chore(deps): update weekly update (#13437)
renovate[bot] Mar 3, 2025
c04d3ef
Group renovate updates for jackson (#13433)
laurit Mar 3, 2025
382cda8
Merge branch 'main' into AgentForTestingTest-exportAndRetrieve-metrics
laurit Mar 3, 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 @@ -9,6 +9,7 @@

import io.opentelemetry.api.GlobalOpenTelemetry;
import io.opentelemetry.javaagent.testing.common.AgentTestingExporterAccess;
import io.opentelemetry.sdk.metrics.data.MetricData;
import io.opentelemetry.sdk.trace.data.SpanData;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -27,11 +28,20 @@ void empty() {
}

@Test
void exportAndRetrieve() {
void exportAndRetrieveSpans() {
GlobalOpenTelemetry.getTracer("test").spanBuilder("test").startSpan().end();

List<SpanData> spans = AgentTestingExporterAccess.getExportedSpans();
assertEquals(1, spans.size());
assertEquals("test", spans.get(0).getName());
}

@Test
void exportAndRetrieveMetrics() {
GlobalOpenTelemetry.getMeter("test").upDownCounterBuilder("test").build().add(1);

List<MetricData> metrics = AgentTestingExporterAccess.getExportedMetrics();
assertEquals(1, metrics.size());
assertEquals("test", metrics.get(0).getName());
}
}
Loading