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

Span event count limit doesn't work when set to 0 #2670

Closed
Bataran opened this issue Dec 16, 2021 · 0 comments · Fixed by #2679
Closed

Span event count limit doesn't work when set to 0 #2670

Bataran opened this issue Dec 16, 2021 · 0 comments · Fixed by #2679
Labels
bug Something isn't working

Comments

@Bataran
Copy link
Contributor

Bataran commented Dec 16, 2021

Please answer these questions before submitting a bug report.

What version of OpenTelemetry are you using?

"@opentelemetry/api": "1.0.3",
"@opentelemetry/sdk-trace-base": "1.0.1"

What version of Node are you using?

v16.13.0.

Please provide the code you used to setup the OpenTelemetry SDK

// index.js
const opentelemetry = require('@opentelemetry/api');
const { BasicTracerProvider } = require('@opentelemetry/sdk-trace-base');

new BasicTracerProvider().register();

const span = opentelemetry.trace.getTracer('default').startSpan('foo');

span.setAttribute('key', 'value');
span.addEvent('some-event-1');
span.addEvent('some-event-2');
span.addEvent('some-event-3');
// the span has 1 event even though it's been run with OTEL_SPAN_EVENT_COUNT_LIMIT=0
span.end();

What did you do?

I started the script with OTEL_SPAN_EVENT_COUNT_LIMIT set to 0
env OTEL_SPAN_EVENT_COUNT_LIMIT=0 node index.js

What did you expect to see?

I expected to have no events in the span

What did you see instead?

There is one event ('some-event-3') in the span

Additional context

I think the problem exists here.

Add any other context about the problem here.

@Bataran Bataran added the bug Something isn't working label Dec 16, 2021
@Bataran Bataran changed the title Span event limit doesn't work when set to 0 Span event count limit doesn't work when set to 0 Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant