Skip to content

test: add end-to-end tests for opentelemetry #1369

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

Merged
merged 1 commit into from
Mar 27, 2025

Conversation

rowanmanning
Copy link
Member

@rowanmanning rowanmanning commented Mar 26, 2025

I wasn't super confident after the recent major update and it led to me doing lots of tests across apps, symlinking in the new package version, and manually checking that metrics and traces were still being sent.

I realised that this could be automated. I've added an end-to-end test where we spin up two Node.js apps - one collector and one regular app with OpenTelemetry added. We capture logs from both and this allows us to verify the basic case of "do metrics/traces get from an app to the configured collector?"

OpenTelemetry uses Protobuf to communicate and it's a real pain to get the parser working. I spent an hour then decided to give up - the key thing is that we see the application's system code in the body that's sent to the collector, we don't want to end up testing OpenTelemetry internals by verifying that the body is valid.

@rowanmanning rowanmanning enabled auto-merge (rebase) March 26, 2025 13:32
Copy link
Contributor

@CyntiBinti CyntiBinti left a comment

Choose a reason for hiding this comment

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

nice 👌🏽

I wasn't super confident after the recent major update and it led to me
doing lots of tests across apps, symlinking in the new package version,
and manually checking that metrics and traces were still being sent.

I realised that this could be automated. I've added an end-to-end test
where we spin up two Node.js apps - one collector and one regular app
with OpenTelemetry added. We capture logs from both and this allows us
to verify the basic case of "do metrics/traces get from an app to the
configured collector?"
@rowanmanning rowanmanning force-pushed the opentelemetry-end-to-end-test branch from 7b1ff6c to c9f8e19 Compare March 27, 2025 12:58
@rowanmanning rowanmanning merged commit e46e935 into main Mar 27, 2025
11 checks passed
@rowanmanning rowanmanning deleted the opentelemetry-end-to-end-test branch March 27, 2025 13:00
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.

2 participants