Skip to content

Conversation

@ashhSAG93
Copy link
Contributor

@ashhSAG93 ashhSAG93 commented Mar 10, 2023

The PR descibes how we can use the OpenTelemetry Exporter for Platform built in the PR DM-1876 OpenTelemetry PlatformMetricExporter, and some of the limitations with regards to OpenTelemetry Metrics instrumentation. The PR is in draft state and not to be reviewed

@ashhSAG93 ashhSAG93 requested a review from l2p- as a code owner March 10, 2023 12:19
import java.util.List;

@Component
public class GaugeStorage {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This component stores the list of gauge callbacks to be closed post export. See the comment mentioned in PR for the explanation

.gaugeBuilder("hwGaugeMetricStSt")
.buildWithCallback(
getObservableDoubleMeasurementConsumer(value, recordedTime));
gaugeStorage.addObservableGauge(gauge);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Store the gauge in the list post instrumentation of metric

return "test";
}

private Consumer<ObservableDoubleMeasurement> getObservableDoubleMeasurementConsumer(int value, DateTime recordedTime) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Attributes used to record time at which the metric point was actually instrumented. Refer https://github.com/SoftwareAG/cumulocity-clients-java/pull/273/files#r1132329707 for explanation


@Override
public void onApplicationEvent(ExportCompletedEvent event) {
int metricCollectionSize = event.getMetricCollectionSize();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Post export, close the list of gauges recorded.

@l2p- l2p- removed their request for review October 8, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant