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

Export internal metrics using OTEL metrics #1425

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

Conversation

marctc
Copy link
Contributor

@marctc marctc commented Dec 2, 2024

This PR adds the ability to exporter Beyla internal metrics for users that are using OpenTelemetry metrics.

Fixes #1211

docs/sources/configure/options.md Outdated Show resolved Hide resolved
docs/sources/configure/options.md Outdated Show resolved Hide resolved
Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

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

LGTM! Sweet!

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 3.67647% with 131 lines in your changes missing coverage. Please review.

Project coverage is 71.62%. Comparing base (043c46e) to head (4e0313b).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pkg/export/otel/metrics_internal.go 0.00% 111 Missing ⚠️
pkg/components/beyla.go 26.31% 12 Missing and 2 partials ⚠️
pkg/beyla/config.go 0.00% 4 Missing and 2 partials ⚠️

❗ There is a different number of reports uploaded between BASE (043c46e) and HEAD (4e0313b). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (043c46e) HEAD (4e0313b)
unittests 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1425      +/-   ##
==========================================
- Coverage   80.97%   71.62%   -9.36%     
==========================================
  Files         146      146              
  Lines       14843    15043     +200     
==========================================
- Hits        12019    10774    -1245     
- Misses       2235     3546    +1311     
- Partials      589      723     +134     
Flag Coverage Δ
integration-test 58.49% <3.67%> (-0.59%) ⬇️
k8s-integration-test 59.48% <3.67%> (-0.57%) ⬇️
oats-test 33.62% <3.67%> (-0.28%) ⬇️
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -7,7 +7,8 @@ import (

// Config options for the different metrics exporters
type Config struct {
Prometheus PrometheusConfig `yaml:"prometheus,omitempty"`
Prometheus PrometheusConfig `yaml:"prometheus,omitempty"`
OTELMetrics bool `yaml:"otel_metrics,omitempty" env:"BEYLA_INTERNAL_METRICS_OTEL_METRICS"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe to be less redundant, rename YAML property to otel or use_otel and the env var to BEYLA_INTERNAL_METRICS_OTEL or BEYLA_INTERNAL_METRICS_USE_OTEL?

Even, to rely less on booleans for config, replace this property for something like protocol or exporter, which can be none, prometheus or otel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even, to rely less on booleans for config, replace this property for something like protocol or exporter, which can be none, prometheus or otel.

Is not a bad idea, but that would imply breaking changes, no? basically we have to force everyone to set exporter and prometheus config for internal metrics.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can document that breaking change in Beyla 2.0.

If we want to keep backwards compatibility, maybe we could default it to prometheus, and explain that it will only have effect if the prometheus subsection is set.

But anyway that was just a suggestion. I'm fine with current implementation.

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.

Export internal metrics using OTEL metrics
3 participants