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

StableOtlpHTTPExporter implementation #476

Merged

Conversation

jhoongo
Copy link
Contributor

@jhoongo jhoongo commented Oct 11, 2023

Issue Details

Current state of OpenTelemetry-Swift lacks an ability to HTTP Exporter for StableMetric and few ability to set aggregationTemporality for metrics and monotonic type.

This PR implements StableOtlpHTTPMetricExporter to implement the missing capabilities.

Implementation Details

  • Implemented StableOtlpHTTPExporterBase and StableOtlpHTTPMetricExporter
  • Adjusted StableMetricData to have isMonotonic and aggregationTemporality
  • Updated MetricsAdapter to read isMonotonic and aggregationTemporality from it, and prepare the proper request payload for the metrics in protobuf
  • Added custom headers to read from OtlpConfiguration for each request

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 11, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: jhoongo / name: James Go (3919cb0)

@jhoongo jhoongo marked this pull request as ready for review October 16, 2023 17:02
@@ -97,14 +97,15 @@ public enum MetricsAdapter {
protoDataPoint.value = .asInt(Int64(gaugeData.value))
protoMetric.gauge.dataPoints.append(protoDataPoint)
case .LongSum:
guard let gaugeData = $0 as? LongPointData else {
guard let gaugeData = $0 as? LongPointData else {
Copy link
Member

Choose a reason for hiding this comment

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

white-space is off: should be 2 spaces indentation.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 32 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...Metrics/Stable/Aggregation/LongSumAggregator.swift 80.00% <100.00%> (ø)
...elemetryProtocolCommon/metric/MetricsAdapter.swift 48.96% <92.30%> (+9.81%) ⬆️
...trics/Stable/Aggregation/DoubleSumAggregator.swift 0.00% <0.00%> (ø)
...etrySdk/Metrics/Stable/Data/StableMetricData.swift 92.85% <91.66%> (+1.19%) ⬆️
...metryProtocolHttp/StableOtlpHTTPExporterBase.swift 89.65% <89.65%> (ø)
...cs/Stable/Aggregation/AggregationTemporality.swift 35.71% <16.66%> (+35.71%) ⬆️
...ocolHttp/metric/StableOtlpHTTPMetricExporter.swift 69.23% <69.23%> (ø)

... and 1 file with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@jhoongo jhoongo force-pushed the stable-otlp-http-eporter branch 3 times, most recently from 120225e to 163643d Compare October 25, 2023 18:36
@nachoBonafonte nachoBonafonte merged commit f7061de into open-telemetry:main Oct 26, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants