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

Fixes #688: Change service.instance.id serialization to string #793

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

Conversation

Annosha
Copy link

@Annosha Annosha commented Oct 25, 2024

Fixes #688

This PR aims to update Serialization Logic by:

Converting service.instance.id to a string before it is sent in protobuf messages. Any occurrence of service.instance.id in \otel_resource_detector.erl being assigned an integer value was modified to convert it to a binary string format, ensuring compliance with the expected data type.

Note: As a new contributor, I encountered difficulties in running tests due to a lack of documentation regarding the testing tools in the OpenTelemetry Erlang repository. Consequently, I am relying on CI/CD tests for my initial pull request. I would greatly appreciate any guidance on setting up the testing environment.

For your reference, I am using Windows with the following Erlang version: Erlang (SMP, ASYNC_THREADS) (BEAM) emulator version 15.1.2. I am currently facing challenges in setting up Rebar3.

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.86%. Comparing base (3a8cbe1) to head (a28238d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #793      +/-   ##
==========================================
- Coverage   73.20%   64.86%   -8.35%     
==========================================
  Files          64       64              
  Lines        1941     1941              
==========================================
- Hits         1421     1259     -162     
- Misses        520      682     +162     
Flag Coverage Δ
api 61.04% <ø> (-8.87%) ⬇️
elixir 17.32% <ø> (ø)
erlang 65.86% <100.00%> (-8.67%) ⬇️
exporter 72.35% <ø> (-0.82%) ⬇️
sdk 66.66% <100.00%> (-10.64%) ⬇️
zipkin 54.16% <ø> (ø)

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.

@tsloughter
Copy link
Member

Sorry about the lack of docs on testing. You mention not being able to setup rebar3, can you give some more details? Running tests should just require running docker compose up followed by rebar3 ct.

@tsloughter
Copy link
Member

Actually we have service id all wrong. I don't know when this changed but the spec for it is different from when we implemented this and so our implementation needs to change to match https://github.com/open-telemetry/semantic-conventions/blob/d9d1e21a5bbb37fe8facea323491d59342a5f810/docs/attributes-registry/service.md#service-instance-id

Would you like to continue the work? Otherwise I can hop on this right away as its a bug and major difference to the spec.

Thanks for bringing it to our attention!

@Annosha
Copy link
Author

Annosha commented Oct 26, 2024

@tsloughter I am not highly experienced in Erlang and am focusing on beginner-friendly issues for my contributions. Please feel free to proceed with the work. I would greatly appreciate any assistance in ensuring this PR is accurate and ready for merging.

@Annosha
Copy link
Author

Annosha commented Oct 26, 2024

@tsloughter I have set up Rebar3; a system restart was required to update the environment variables. I’ve implemented the fixes in the latest commit, but I'm encountering errors when running rebar3 ct on my machine. I’m attaching the error log—could you please review it and advise if the issues are related to the changes I made?
Uploading error-log.txt…

@tsloughter
Copy link
Member

@Annosha hey, sorry, that link to uploaded error log doesn't work. Could you just push the changes so we can see if they pass in github CI?

@Annosha
Copy link
Author

Annosha commented Nov 2, 2024

@tsloughter sorry about the file, here is the error log. And I have pushed changes here in this PR tho.
error-log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

service.instance.id is sent as an integer, not as a string in protobuf messages
2 participants