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

Provide operational metrics in OpenTelemetry Collector #3078

Open
2 of 3 tasks
Tracked by #3698
tomkerkhove opened this issue May 30, 2022 · 11 comments
Open
2 of 3 tasks
Tracked by #3698

Provide operational metrics in OpenTelemetry Collector #3078

tomkerkhove opened this issue May 30, 2022 · 11 comments
Assignees
Labels
feature All issues for new features that have been committed to opentelemetry operations

Comments

@tomkerkhove
Copy link
Member

tomkerkhove commented May 30, 2022

Proposal

Provide operational metrics, that we have for Prometheus today, but push them to an OpenTelemetry Collector through OTEL.

Use-Case

Allow end-users to choose which metrics platform to use, instead of only supporting Prometheus.

Status

  • Feature implementation
  • Provide docs
  • Integrate in Helm chart

Anything else?

A proposal is open on #1281 to bring scaler metrics to OpenTelemetry Collector as well.

@tomkerkhove tomkerkhove added needs-discussion feature-request All issues for new features that have not been committed to labels May 30, 2022
@stale
Copy link

stale bot commented Jul 29, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Jul 29, 2022
@tomkerkhove tomkerkhove added feature All issues for new features that have been committed to operations and removed needs-discussion feature-request All issues for new features that have not been committed to labels Aug 1, 2022
@stale
Copy link

stale bot commented Aug 8, 2022

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Aug 8, 2022
@tomkerkhove tomkerkhove reopened this Aug 8, 2022
@tomkerkhove tomkerkhove added the help wanted Looking for support from community label Aug 8, 2022
@stale stale bot removed stale All issues that are marked as stale due to inactivity labels Aug 8, 2022
@tomkerkhove
Copy link
Member Author

@ilyalexin this is the issue that we discussed as a good starting point for OTEL Collector integration.

This should be supported in both Operator & Metric Server and have parity with https://keda.sh/docs/2.9/operate/prometheus/.

@tomkerkhove
Copy link
Member Author

Related: #3695

@ilaleksin
Copy link

In order to resolve implement this feature one need to import opentelemetry sdk
At this moment keda has indirect dependency to opentelemetry v0.20.0 through k8s/api-server v0.25.4

In order to use opentelemtry v1.0+ we need to update api-server to v0.26.0

This work is already in progress under #4107

@tomkerkhove
Copy link
Member Author

@kedacore/keda-maintainers Do we have an agreement that this is a nice addition?

@JorTurFer
Copy link
Member

yeah, I think that generating OpenTelemetry data is worth. In our case for example, we have to deploy a Prometheus server to scrape metrics from other services (like KEDA, nginx, etc) and our collector scrapes that prometheus server to send the telemetry to the final backend (I know that collector can scrape the services directly, but it doesn't support Prometheus operator CRDs).
If KEDA (and other services) supports OpenTelemetry Protocol, we can use it to send the metrics directly to the collector and route them from there as we want

@tomkerkhove
Copy link
Member Author

💯 - I'll get this on our roadmap to contribute from Microsoft side!

@SpiritZhou SpiritZhou self-assigned this Jul 11, 2023
@SpiritZhou
Copy link
Contributor

Hi @tomkerkhove @JorTurFer ,

Here is my basic design for implementing this feature:

  1. Users can select their preferred metrics collection mode (Prometheus Only/OpenTelemetry Only/Prometheus and OpenTelemetry Both) using environment variables. The Keda operator will read these configuration settings (PROMETHEUS_ENABLE, OPENTELEMETRY_ENABLE, and OPENTELEMETRY_ENDPOINT).
  2. Refactor the current Prometheus.go file by adding a middleware struct, such as MetricLogger, to handle initialization and metrics collection for both Prometheus and OpenTelemetry.

Do you have any suggestions regarding this design?

@JorTurFer
Copy link
Member

I agree with this implementation. It's more or less what I thought about it indeed.
The only thing that I'd change is that instead of using new env vars for OTEL, I prefer to use the predefined variables when it's possible: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/

@JorTurFer
Copy link
Member

I've found this exporter that we could use for exporting logs too: https://github.com/agoda-com/opentelemetry-go/tree/main/otelzap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature All issues for new features that have been committed to opentelemetry operations
Projects
Status: In Review
Development

No branches or pull requests

4 participants