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

OpenTelemetry metrics output #2557

Closed
pragmaticivan opened this issue Jun 3, 2022 · 8 comments · Fixed by #3834
Closed

OpenTelemetry metrics output #2557

pragmaticivan opened this issue Jun 3, 2022 · 8 comments · Fixed by #3834
Assignees
Labels
feature metrics-output Issues related to the metrics output (a.k.a. just output) opentelemetry
Milestone

Comments

@pragmaticivan
Copy link

Feature Description

Add support for exporting metrics via OTLP in addition to Statsd

Suggested Solution (optional)

https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp

GO SDK

Already existing or connected issues / PRs (optional)

No response

@na--
Copy link
Member

na-- commented Jun 9, 2022

Thanks for opening the issue and sorry for the slow response! I haven't followed OpenTelemetry closely, so I am very out of touch where it's at in terms of features, stabilization and adoption. It's something we'll probably want to have support for in the k6 core in the future, but I can't give an estimate on when exactly that will be.

We have slowly been refactoring and improving the metrics internals in k6 over the last several releases to make such efforts easier and cleaner (#2071, #2330, #2426, #2463, #2433, #2442 among others), and we'll continue to do so for a while with things like #1831, #1889, #572, #2430, etc. The near-term goal is to natively support OpenMetrics / Prometheus metrics (#858) in the k6 core, though probably just through remote write initially (#1761). OTLP will probably be on the agenda relatively soon after that, though I can't make any promises yet...

The good news is that you don't have to wait for us to support it in the core before you can use it with k6! k6 supports output extensions through xk6 and you can write one for OTLP metrics yourself. It may be a bit rough or require some hacks before we've finished with all of the planned refactoring tasks I linked to above, but something should still be possible. For examples, see https://github.com/grafana/xk6-output-prometheus-remote or other output extensions in https://k6.io/docs/extensions/

@na-- na-- added the evaluation needed proposal needs to be validated or tested before fully implementing it in k6 label Jun 9, 2022
@gurudatta-carbon
Copy link

any update on this? most of the grafana offered products support opentelemetry, it would be nice if k6 can support opentelemetry integration for metrics, traces.

@codebien codebien changed the title Add OTLP Metric export support OpenTelemetry output Feb 1, 2024
@codebien codebien changed the title OpenTelemetry output OpenTelemetry metrics output Feb 1, 2024
@codebien codebien removed the evaluation needed proposal needs to be validated or tested before fully implementing it in k6 label Feb 1, 2024
@codebien
Copy link
Contributor

codebien commented Feb 1, 2024

We had a quick internal sync around this issue. We intend to wrap the OTel Go SDK in a metric output.
The path should be as usual to have an output extension (e.g. xk6-output-open-telemetry) then move it to the core. Potentially, directly to the core as an experimental output if we are confident enough.

The output should provide the way to configure the aggregation temporality via an option. Ideally, both, delta and cumulative will be supported but if some order of precedence is required then cumulative will be the first. As it is the natural way for supporting Prometheus.

@mshoosht-cisco
Copy link

mshoosht-cisco commented Feb 12, 2024

We had a quick internal sync around this issue. We intend to wrap the OTel Go SDK in a metric output.
The path should be as usual to have an output extension (e.g. xk6-output-open-telemetry) then move it to the core. Potentially, directly to the core as an experimental output if we are confident enough.

Is there a branch or new repo with this work?

@codebien
Copy link
Contributor

Hey @mshoosht-cisco, no there isn't yet any concrete implementation available. Would you like to contribute or just try to use it?

@bbortt
Copy link

bbortt commented Mar 20, 2024

@codebien if you're looking for alpha testers, I am here 😉

@olegbespalov
Copy link
Contributor

Hey there!

I'm happy to update this issue with the details that the core team actually started the work on the open telemetry output.

We've created the extension repository https://github.com/grafana/xk6-output-opentelemetry

After a few PRs (grafana/xk6-output-opentelemetry#3), it will actually start sending some metrics to the OpenTelemetry.

There are still many things to do, but we aim to include this output as the experimental in the core.

Any feedback is welcome!

cc: @mshoosht-cisco @bbortt

@olegbespalov
Copy link
Contributor

Hey there again!

I want to update you that we finished the first iteration of the work for the open telemetry output extension (v0.1.0). It's available under the https://github.com/grafana/xk6-output-opentelemetry repository, and you should compile the k6 with it to use it.

Our plan is to wait for initial feedback. If nothing critical is spotted with the following k6 v0.53 (and a bit earlier in the latest docker), we will make the extension part of the k6 an experimental output (grafana/xk6-output-opentelemetry#1).

We want to get the usage feedback, so if you have the capacity, please go ahead and try it. If you see any bug or a possible improvement, feel free to open the issue directly in the GitHub repository or write a comment in the issue: grafana/xk6-output-opentelemetry#1.

Community suggestions/thoughts are especially welcome for the issue grafana/xk6-output-opentelemetry#12, where we define the way of handling K6's rate metrics.

@olegbespalov olegbespalov added metrics-output Issues related to the metrics output (a.k.a. just output) opentelemetry labels Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature metrics-output Issues related to the metrics output (a.k.a. just output) opentelemetry
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants