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

Automatically set ip tag #20

Closed
bobrik opened this issue Feb 2, 2020 · 4 comments · Fixed by #36
Closed

Automatically set ip tag #20

bobrik opened this issue Feb 2, 2020 · 4 comments · Fixed by #36

Comments

@bobrik
Copy link
Contributor

bobrik commented Feb 2, 2020

There's already a constant for it: TRACER_IP_TAG_KEY.

Jaeger uses ip tag to group spans around individual machines for clock skew adjustment and with futures it's easy to mess up and make child spans outlive parents, triggering time travel bamboozle:

It's probably best to infer ip tag automatically just like C++ and Go clients do.

@sile
Copy link
Owner

sile commented Feb 3, 2020

Thank you for you proposal. It seems nice feature. Let me label this issue as a help wanted because I don't have enough time to implement it.

@anirudhRowjee
Copy link
Contributor

Hello! I'd like to work on this, but don't exactly know where to get started. I'd appreciate any guidance on the same.
Thank you!

@sile
Copy link
Owner

sile commented Feb 6, 2023

@anirudhRowjee Thank you. I think you can implement this feature like the code setting hostname tag (see below).

https://github.com/sile/rustracing_jaeger/blob/master/src/reporter.rs#L152-L154

if let Ok(Ok(hostname)) = hostname::get().map(|h| h.into_string()) {
    this.add_service_tag(Tag::new(constants::TRACER_HOSTNAME_TAG_KEY, hostname));
}

@anirudhRowjee
Copy link
Contributor

Thank you for the guidance! I'm in a much better place to start now.
I'm considering introducing this crate (https://docs.rs/local-ip-address/latest/local_ip_address/) as an external dependency, and would appreciate any advice on the same - I'll be working on a PR for this until then!

Once again, thank you for your time!

anirudhRowjee added a commit to anirudhRowjee/rustracing_jaeger that referenced this issue Feb 6, 2023
@sile sile closed this as completed in #36 Feb 7, 2023
sile added a commit that referenced this issue Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants