Skip to content

Commit

Permalink
Fix a metrics API bridging issue (#6034)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek authored May 16, 2022
1 parent 59e47a2 commit 18352ff
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

dependencies {
compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "shadow"))
compileOnly(project(":opentelemetry-api-shaded-for-instrumenting", configuration = "v1_10"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.0:javaagent"))
implementation(project(":instrumentation:opentelemetry-api:opentelemetry-api-1.4:javaagent"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

public final class ApplicationObservableDoubleCounter implements ObservableDoubleCounter {

private final io.opentelemetry.api.metrics.ObservableDoubleCounter agentCounter;

public ApplicationObservableDoubleCounter(
io.opentelemetry.api.metrics.ObservableDoubleCounter agentCounter) {}
io.opentelemetry.api.metrics.ObservableDoubleCounter agentCounter) {
this.agentCounter = agentCounter;
}

// not adding @Override because this method was introduced in 1.12
@SuppressWarnings("unused")
public void close() {
agentCounter.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

public final class ApplicationObservableDoubleGauge implements ObservableDoubleGauge {

private final io.opentelemetry.api.metrics.ObservableDoubleGauge agentGauge;

public ApplicationObservableDoubleGauge(
io.opentelemetry.api.metrics.ObservableDoubleGauge agentGauge) {}
io.opentelemetry.api.metrics.ObservableDoubleGauge agentGauge) {
this.agentGauge = agentGauge;
}

// not adding @Override because this method was introduced in 1.12
@SuppressWarnings("unused")
public void close() {
agentGauge.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
public final class ApplicationObservableDoubleUpDownCounter
implements ObservableDoubleUpDownCounter {

private final io.opentelemetry.api.metrics.ObservableDoubleUpDownCounter agentUpDownCounter;

public ApplicationObservableDoubleUpDownCounter(
io.opentelemetry.api.metrics.ObservableDoubleUpDownCounter agentUpDownCounter) {}
io.opentelemetry.api.metrics.ObservableDoubleUpDownCounter agentUpDownCounter) {
this.agentUpDownCounter = agentUpDownCounter;
}

// not adding @Override because this method was introduced in 1.12
@SuppressWarnings("unused")
public void close() {
agentUpDownCounter.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

public final class ApplicationObservableLongCounter implements ObservableLongCounter {

private final io.opentelemetry.api.metrics.ObservableLongCounter agentCounter;

public ApplicationObservableLongCounter(
io.opentelemetry.api.metrics.ObservableLongCounter agentCounter) {}
io.opentelemetry.api.metrics.ObservableLongCounter agentCounter) {
this.agentCounter = agentCounter;
}

// not adding @Override because this method was introduced in 1.12
@SuppressWarnings("unused")
public void close() {
agentCounter.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

public final class ApplicationObservableLongGauge implements ObservableLongGauge {

private final io.opentelemetry.api.metrics.ObservableLongGauge agentGauge;

public ApplicationObservableLongGauge(
io.opentelemetry.api.metrics.ObservableLongGauge agentGauge) {}
io.opentelemetry.api.metrics.ObservableLongGauge agentGauge) {
this.agentGauge = agentGauge;
}

// not adding @Override because this method was introduced in 1.12
@SuppressWarnings("unused")
public void close() {
agentGauge.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@

public final class ApplicationObservableLongUpDownCounter implements ObservableLongUpDownCounter {

private final io.opentelemetry.api.metrics.ObservableLongUpDownCounter agentUpDownCounter;

public ApplicationObservableLongUpDownCounter(
io.opentelemetry.api.metrics.ObservableLongUpDownCounter agentUpDownCounter) {}
io.opentelemetry.api.metrics.ObservableLongUpDownCounter agentUpDownCounter) {
this.agentUpDownCounter = agentUpDownCounter;
}

// not adding @Override because this method was introduced in 1.12
@SuppressWarnings("unused")
public void close() {
agentUpDownCounter.close();
}
}
Loading

0 comments on commit 18352ff

Please sign in to comment.