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

Allow disabling hb_id #377

Open
slashmo opened this issue Feb 9, 2024 · 6 comments
Open

Allow disabling hb_id #377

slashmo opened this issue Feb 9, 2024 · 6 comments

Comments

@slashmo
Copy link
Contributor

slashmo commented Feb 9, 2024

When using Distributed Tracing with a metadata provider, Hummingbird logs get span and trace ID metadata values automatically. This makes the hb_id metadata value a bit superfluous and it adds unnecessary bloat to the log statements. Therefore, it would be great if one could disable it.

@adam-fowler
Copy link
Member

hb_id allows you to associate a trace entry with entries in your log.

@slashmo
Copy link
Contributor Author

slashmo commented Feb 10, 2024

hb_id allows you to associate a trace entry with entries in your log.

Isn't that what the metadata provider provided trace/span IDs already do?

@thoven87
Copy link

hb_id allows you to associate a trace entry with entries in your log.

is hb_id used internally to attach span_id/trace_id to the logger? I just started playing with Hummingbird along with swift-otel. I noticed each log has span_id, trace_id and hb_id, since swift-otel does support log export with OTEL yet; I will try running Grafana agent to see if I can correlate logs with traces.

@slashmo
Copy link
Contributor Author

slashmo commented Feb 10, 2024

span_id and trace_id are attached via the logging metadata handler from swift-otel. hb_id is not related to that. Log correlation works well with various observability tools.

@thoven87
Copy link

span_id and trace_id are attached via the logging metadata handler from swift-otel. hb_id is not related to that. Log correlation works well with various observability tools.

I think I understand what hb_id is now. Please correct me if I am wrong @adam-fowler hb_id can be interpreted as request_id (an idempotency key) which can used to identify retries, it can be used to guaranteed at least once delivery e.t.c. Moreover, hb_id can be injected into any subsequent calls to other services to follow a request journey across external services as well.

@adam-fowler
Copy link
Member

Sorry took so long to reply.

hb_id is used to identify log entries that belong to a single request regardless of whether you are using Tracing or not. If the logger is passed down to services the request uses then those services log entries will include it as well.

If you really want to remove the hb_id metadata from your log entries you could write a middleware that removes it from the logger.

Originally I wanted to use metadata providers in Hummingbird but I haven't found a method where I can use them without trampling over metadata from other system eg swift-otel

@slashmo Out of interest when are the trace-id and span-id set?

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

No branches or pull requests

3 participants