-
Notifications
You must be signed in to change notification settings - Fork 211
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
15skumar
wants to merge
5
commits into
awslabs:main
Choose a base branch
from
15skumar:otel-metrics-cli
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]>
Signed-off-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]>
Signed-off-by: Shivangi Kumar <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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).