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

Access to underlying libhoney::Client #19

Open
Procrat opened this issue Feb 15, 2022 · 0 comments
Open

Access to underlying libhoney::Client #19

Procrat opened this issue Feb 15, 2022 · 0 comments

Comments

@Procrat
Copy link

Procrat commented Feb 15, 2022

Hi there! Thank you for maintaining the tracing-honeycomb crate!

We would like to add an extra default field to the Honeycomb client. However, I don't think we're currently able to do so. Would you be open to making some crate-public fields public?

This snippet

let mut client = libhoney::init(honeycomb_config);
client.add_field("my-field", some_value);
// let telemetry = HoneycombTelemetry::new(Mutex::new(client), Some(sample_rate));
let telemetry = HoneycombTelemetry {
    reporter: LibhoneyReporter::new(client),
    sample_rate: Some(sample_rate),
};
let layer = TelemetryLayer::new("my-service", telemetry, move |tracing_id| SpanId { tracing_id })

currently fails with

error[E0451]: field `reporter` of struct `tracing_honeycomb::HoneycombTelemetry` is private
   |
73 |             reporter: LibhoneyReporter::new(client),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private field

error[E0451]: field `sample_rate` of struct `tracing_honeycomb::HoneycombTelemetry` is private
   |
74 |             sample_rate: Some(sample_rate),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private field

error[E0451]: field `tracing_id` of struct `tracing_honeycomb::SpanId` is private
  --> narrative-maxwell/src/util/tracing.rs:76:78
   |
76 |         TelemetryLayer::new("maxwell", telemetry, move |tracing_id| SpanId { tracing_id })
   |                                                                              ^^^^^^^^^^ private field
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

1 participant