Skip to content

Add CLI option for publishing OTEL metrics to an endpoint #1552

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

15skumar
Copy link

This PR adds a CLI argument which enables users to run Mountpoint with the functionality of publishing metrics to a specified endpoint.

No impact on existing behavior. This CLI option is under a compile time flag.

Added functionality:
Run Mountpoint with --log-metrics-otlp http://localhost:4318 flag to enable publishing metrics to port 4318 (otlp port)
Optionally you can also specify the exporting interval with the --log-metrics-otlp-interval flag.

To verify the implementation I ran a docker container running the OpenTelemetry Collector at the default port, and ran Mountpoint with the new flag with endpoint specified.
I verified that the Mountpoint metrics were visible in the collector logs. Here is a screenshot of an example Mountpoint metric collected at the endpoint:

Screenshot 2025-07-31 at 17 39 57

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

15skumar and others added 5 commits July 31, 2025 13:14
This PR adds an implementation of OpenTelemetry Exporting of metrics
through the OpenTelemetry protocol (OTLP). Changes are: a new
OtlpMetricsExporter struct which handles exporting metrics to an OTLP
endpoint, and integration of the OTLP exporter with the existing metrics
system.

Testing:
I tested the implementation with a test otlp_metrics() in metrics.rs and
ran a docker container running the OpenTelemetry Collector at the
default port

docker run -d --name otel-collector \
  -p 4318:4318 -p 4317:4317 \
  -v $(pwd)/collector-config.yaml:/etc/otelcol/config.yaml \
  otel/opentelemetry-collector-contrib:latest

Once I ran the test, I verified that the test metrics can be viewed in
the collector logs. (viewed using 'docker logs otel-collector'). Here is
a screenshot of an example of a test metric collected at the endpoint:
<img width="391" alt="Screenshot 2025-06-18 at 15 32 16"
src="https://github.com/user-attachments/assets/aab7e20a-0472-495b-af1d-23e966495e21"
/>

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and I agree to the terms of
the [Developer Certificate of Origin
(DCO)](https://developercertificate.org/).

---------

Signed-off-by: Shivangi Kumar <[email protected]>
Co-authored-by: Shivangi Kumar <[email protected]>
…o default (unnecessary) OpenTelemetry dimensions don't get sent to endpoint

Signed-off-by: Shivangi Kumar <[email protected]>
No impact on existing behavior, only adding on to existing behavior.
Note that we have removed publishing of Histogram metrics for now while
we figure out how to integrate the percentiles into CloudWatch. All
other metrics, i.e. counters and gauges are published.

This PR adds a CLI argument which enables users to run Mountpoint with
the functionality of publishing metrics to a specified endpoint,.

Added functionality:
Run Mountpoint with `--log-metrics-otlp http://localhost:4318` flag to
enable publishing metrics to port 4318 (otlp port)
Optionally you can also specify the exporting interval with the
`--log-metrics-otlp-interval` flag.

To verify the implementation I ran a docker container running the
OpenTelemetry Collector at the default port, and ran Mountpoint with the
new flag with endpoint specified.
I verified that the Mountpoint metrics were visible in the collector
logs. Here is a screenshot of an example Mountpoint metric collected at
the endpoint:
<img width="408" alt="Screenshot 2025-06-24 at 17 23 38"
src="https://github.com/user-attachments/assets/a7acfdda-bb85-4595-96ea-633969418b79"
/>

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and I agree to the terms of
the [Developer Certificate of Origin
(DCO)](https://developercertificate.org/).

---------

Signed-off-by: Shivangi Kumar <[email protected]>
Co-authored-by: Shivangi Kumar <[email protected]>
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
@15skumar 15skumar requested a deployment to PR integration tests July 31, 2025 16:45 — with GitHub Actions Waiting
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.

1 participant