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

[AutoInstrumentation] NodeJS histogram buckets should be configurable #3436

Open
CCOLLOT opened this issue Nov 8, 2024 · 3 comments · May be fixed by #3448
Open

[AutoInstrumentation] NodeJS histogram buckets should be configurable #3436

CCOLLOT opened this issue Nov 8, 2024 · 3 comments · May be fixed by #3448
Labels
bug Something isn't working needs triage

Comments

@CCOLLOT
Copy link

CCOLLOT commented Nov 8, 2024

Component(s)

auto-instrumentation

What happened?

Description

When injecting autoinstrumentation on nodejs apps, we use the default histogram buckets: [ 0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000 ]

While it makes sense for values expressed in ms, it does not work with metrics such as http_server_duration_bucket expressed in seconds.

It seems other SDKs face(d) the same issue:

I would expect to be able to configure the bucket list for metrics to adjust to the currently used unit, ideally through the Instrumentation CRD. As I understand it, we could, for example, pass a view to the created NodeSDK

While this is not an issue for span metrics or service-graph metrics (buckets can be configured downstream), it makes other metrics like http_server_duration_bucket unusable.

Kubernetes Version

1.30

Operator version

0.111.0

Collector version

0.111.0

Environment information

No response

Log output

No response

Additional context

No response

@swiatekm
Copy link
Contributor

It looks like this was fixed in the instrumentation library itself for both dotnet and Go. Why aren't we doing the same thing for js?

@CCOLLOT
Copy link
Author

CCOLLOT commented Nov 11, 2024

It looks like this was fixed in the instrumentation library itself for both dotnet and Go. Why aren't we doing the same thing for js?

As far as I understand the Go SDK did not introduce a fix as maintainers refused to implement it.

Besides, even if the upstream project used another hardcoded set of buckets with the correct unit (seconds), an end-user might want to be able to change them.

I've seen comments from SDK maintainers arguing that one should just pass a view instead of modifying the default histogram buckets... But it cannot be done when using autoinstrumentation injection because the point is to avoid modifying the app's code :(.

@swiatekm
Copy link
Contributor

I wonder if introducing a non-standard environment variable here is the way to go, or if we should add an attribute on the Instrumentation CR instead. I'd like to get opinions from the JS maintainers first, in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
2 participants