Skip to content

Commit

Permalink
little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
EddeCCC committed Nov 19, 2024
1 parent ad57957 commit 5a2b37b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void updateMethodHooks(
/** Sets up self-monitoring to record the amount of instrumented classes. */
private void setUpSelfMonitoring() {
Consumer<ObservableDoubleMeasurement> callback =
(measurment) -> measurment.record(activeInstrumentations.estimatedSize());
(measurement) -> measurement.record(activeInstrumentations.estimatedSize());
MetricFactory.createObservableDoubleGauge("inspectit.self.instrumented-classes", callback);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import io.opentelemetry.api.metrics.ObservableDoubleGauge;
import io.opentelemetry.api.metrics.ObservableDoubleMeasurement;
import io.opentelemetry.sdk.metrics.export.MetricExporter;
import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader;
import java.util.function.Consumer;
import rocks.inspectit.gepard.agent.internal.otel.OpenTelemetryAccessor;

Expand All @@ -13,9 +13,8 @@ public class MetricFactory {
private MetricFactory() {}

/**
* Creates an observable gauge metric. This gauge will record a value via calling the callback
* function everytime it is observed. The gauge is observed when the OpenTelemetry {@link
* MetricExporter} exports data.
* Creates an observable gauge metric. This gauge will record a measurement via calling the
* callback function everytime it is observed by the {@link PeriodicMetricReader}.
*
* @param name the name of the gauge
* @param callback the callback function to record a measurement
Expand Down

0 comments on commit 5a2b37b

Please sign in to comment.