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

V2 rain #5

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@
**/*.rs.bk
Cargo.lock
honeycomb.key
tracing-honeycomb/proptest-regressions/*
.idea/*
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
members = [
"tracing-distributed",
"tracing-honeycomb",
]
]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ See [`tracing-honeycomb`](tracing-honeycomb/README.md) for examples.
## License

This project is licensed under the terms of the MIT license

4 changes: 2 additions & 2 deletions tracing-distributed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ tracing = "0.1.12"
tracing-core = "0.1.9"
tracing-subscriber = "0.2.0"
chrono = "0.4.9"
itertools = "0.8.1"
itertools = "0.9"

[dev-dependencies]
tracing-attributes = "0.1.5"
futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] }
tokio = { version = "0.2", features = ["full"] }
tracing-futures = "0.2.1"
tracing-futures = "0.2.1"
2 changes: 1 addition & 1 deletion tracing-distributed/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![tracing-distributed on crates.io](https://img.shields.io/crates/v/tracing-distributed)](https://crates.io/crates/tracing-distributed) [![Documentation (latest release)](https://docs.rs/tracing-distributed/badge.svg)](https://docs.rs/tracing-distributed/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_distributed/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)
[![tracing-distributed on crates.io](https://img.shields.io/crates/v/tracing-distributed)](https://crates.io/crates/tracing-distributed) [![Documentation (latest release)](https://docs.rs/tracing-distributed/badge.svg)](https://docs.rs/tracing-distributed/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_distributed/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)[![inanna-malick](https://circleci.com/gh/inanna-malick/honeycomb-tracing.svg?style=svg)](https://app.circleci.com/pipelines/github/inanna-malick/honeycomb-tracing)

Choose a reason for hiding this comment

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

the alt text inanna-malick should be something like "CircleCI status"


# tracing-distributed

Choose a reason for hiding this comment

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

link to the release docs, master docs, and crates.io here -- all of them have badges. See https://github.com/calibra/cargo-guppy/blob/master/guppy/README.md for an example


Expand Down
2 changes: 1 addition & 1 deletion tracing-distributed/README.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![tracing-distributed on crates.io](https://img.shields.io/crates/v/tracing-distributed)](https://crates.io/crates/tracing-distributed) [![Documentation (latest release)](https://docs.rs/tracing-distributed/badge.svg)](https://docs.rs/tracing-distributed/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_distributed/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)
[![tracing-distributed on crates.io](https://img.shields.io/crates/v/tracing-distributed)](https://crates.io/crates/tracing-distributed) [![Documentation (latest release)](https://docs.rs/tracing-distributed/badge.svg)](https://docs.rs/tracing-distributed/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_distributed/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)[![inanna-malick](https://circleci.com/gh/inanna-malick/honeycomb-tracing.svg?style=svg)](https://app.circleci.com/pipelines/github/inanna-malick/honeycomb-tracing)

Choose a reason for hiding this comment

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

same here


# {{crate}}

Expand Down
2 changes: 1 addition & 1 deletion tracing-honeycomb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] }
tracing-subscriber = "0.2.0"
tokio = { version = "0.2", features = ["full"] }
tracing-futures = "0.2.1"
proptest = "0.9.5"
proptest = "0.9.5"
6 changes: 2 additions & 4 deletions tracing-honeycomb/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![tracing-honeycomb on crates.io](https://img.shields.io/crates/v/tracing-honeycomb)](https://crates.io/crates/tracing-honeycomb) [![Documentation (latest release)](https://docs.rs/tracing-honeycomb/badge.svg)](https://docs.rs/tracing-honeycomb/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_honeycomb/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)
[![tracing-honeycomb on crates.io](https://img.shields.io/crates/v/tracing-honeycomb)](https://crates.io/crates/tracing-honeycomb) [![Documentation (latest release)](https://docs.rs/tracing-honeycomb/badge.svg)](https://docs.rs/tracing-honeycomb/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_honeycomb/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)[![inanna-malick](https://circleci.com/gh/inanna-malick/honeycomb-tracing.svg?style=svg)](https://app.circleci.com/pipelines/github/inanna-malick/honeycomb-tracing)

Choose a reason for hiding this comment

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

same here


# tracing-honeycomb

Expand Down Expand Up @@ -55,9 +55,7 @@ tracing::subscriber::set_global_default(subscriber).expect("setting global defau

### Testing

Since `TraceCtx::current_trace_ctx` and `TraceCtx::record_on_current_span` can be expected to return `Ok` as long as some `TelemetryLayer` has been registered as part of the layer/subscriber stack and the current span is active, it's valid to `.expect` them to always succeed & to panic if they do not. However, you probably don't want to publish telemetry while running unit or integration tests.

This library provides a `BlackholeTelemetry` `Telemetry` instance that discards spans and events without publishing them to any backend. Use as:
Since `TraceCtx::current_trace_ctx` and `TraceCtx::record_on_current_span` can be expected to return `Ok` as long as some `TelemetryLayer` has been registered as part of the layer/subscriber stack and the current span is active, it's valid to `.expect` them to always succeed & to panic if they do not. As a result, you may find yourself writing code that fails if no distributed tracing context is present. This means that unit and integration tests covering such code must provide a `TelemetryLayer`. However, you probably don't want to publish telemetry while running unit or integration tests. You can fix this problem by registering a `TelemetryLayer` constructed using `BlackholeTelemetry`. `BlackholeTelemetry` discards spans and events without publishing them to any backend.

```rust
let telemetry_layer = mk_honeycomb_blackhole_tracing_layer();
Expand Down
6 changes: 2 additions & 4 deletions tracing-honeycomb/README.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![tracing-honeycomb on crates.io](https://img.shields.io/crates/v/tracing-honeycomb)](https://crates.io/crates/tracing-honeycomb) [![Documentation (latest release)](https://docs.rs/tracing-honeycomb/badge.svg)](https://docs.rs/tracing-honeycomb/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_honeycomb/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)
[![tracing-honeycomb on crates.io](https://img.shields.io/crates/v/tracing-honeycomb)](https://crates.io/crates/tracing-honeycomb) [![Documentation (latest release)](https://docs.rs/tracing-honeycomb/badge.svg)](https://docs.rs/tracing-honeycomb/) [![Documentation (master)](https://img.shields.io/badge/docs-master-brightgreen)](https://inanna-malick.github.io/honeycomb-tracing/tracing_honeycomb/)[![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE)[![inanna-malick](https://circleci.com/gh/inanna-malick/honeycomb-tracing.svg?style=svg)](https://app.circleci.com/pipelines/github/inanna-malick/honeycomb-tracing)

Choose a reason for hiding this comment

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

and here


# {{crate}}

Expand Down Expand Up @@ -51,9 +51,7 @@ tracing::subscriber::set_global_default(subscriber).expect("setting global defau

### Testing

Since `TraceCtx::current_trace_ctx` and `TraceCtx::record_on_current_span` can be expected to return `Ok` as long as some `TelemetryLayer` has been registered as part of the layer/subscriber stack and the current span is active, it's valid to `.expect` them to always succeed & to panic if they do not. However, you probably don't want to publish telemetry while running unit or integration tests.

This library provides a `BlackholeTelemetry` `Telemetry` instance that discards spans and events without publishing them to any backend. Use as:
Since `TraceCtx::current_trace_ctx` and `TraceCtx::record_on_current_span` can be expected to return `Ok` as long as some `TelemetryLayer` has been registered as part of the layer/subscriber stack and the current span is active, it's valid to `.expect` them to always succeed & to panic if they do not. As a result, you may find yourself writing code that fails if no distributed tracing context is present. This means that unit and integration tests covering such code must provide a `TelemetryLayer`. However, you probably don't want to publish telemetry while running unit or integration tests. You can fix this problem by registering a `TelemetryLayer` constructed using `BlackholeTelemetry`. `BlackholeTelemetry` discards spans and events without publishing them to any backend.

```rust
let telemetry_layer = mk_honeycomb_blackhole_tracing_layer();
Expand Down
1 change: 1 addition & 0 deletions tracing-honeycomb/src/honeycomb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ mod test {
use proptest::prelude::*;
proptest! {
#[test]
// ua is [1..] and not [0..] because 0 is not a valid tracing::Id (tracing::from_u64 throws on 0)
fn span_id_round_trip(ua in 1u64.., ub in 1u64..) {
inanna-malick marked this conversation as resolved.
Show resolved Hide resolved
let span_id = SpanId {
tracing_id: tracing::Id::from_u64(ua),
Expand Down