-
Notifications
You must be signed in to change notification settings - Fork 11
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
DM 1876 opentelemetry custom exporter for platform used in eg ms #79
base: develop
Are you sure you want to change the base?
DM 1876 opentelemetry custom exporter for platform used in eg ms #79
Conversation
import java.util.List; | ||
|
||
@Component | ||
public class GaugeStorage { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
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