-
Notifications
You must be signed in to change notification settings - Fork 814
Closed
Labels
kind/bugSomething isn't workingSomething isn't working
Description
Bug Report
Version
│ │ ├── tracing v0.1.15
│ │ │ ├── tracing-attributes v0.1.8
│ │ │ └── tracing-core v0.1.10
│ │ │ │ │ │ │ │ └── tracing v0.1.15 (*)
│ │ └── tracing v0.1.15 (*)
├── tracing v0.1.15 (*)
├── tracing-futures v0.2.4
│ └── tracing v0.1.15 (*)
├── tracing-opentelemetry v0.10.0
│ ├── tracing v0.1.15 (*)
│ ├── tracing-core v0.1.10 (*)
│ ├── tracing-log v0.1.1
│ │ └── tracing-core v0.1.10 (*)
│ └── tracing-subscriber v0.2.9
│ ├── tracing-core v0.1.10 (*)
│ ├── tracing-log v0.1.1 (*)
│ └── tracing-serde v0.1.2
│ └── tracing-core v0.1.1
Platform
Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin
Description
Since you can't record a new field on a span after it's been created (per the docs) I wanted to pre-create some fields on the #[instrument(fields(...))]
.
The documentation doesn't suggest this is possible, but gives the example:
let span = trace_span!("my_span", greeting = "hello world", parting = field::Empty);
Given that, I figured that
#[instrument(fields(foo = tracing::field::Empty))]
would make sense.
Sadly, that results in
error: expected literal
--> redacted/mod.rs:168:36
|
168 | #[instrument(fields(foo = tracing::field::Empty), err, skip(registry_client, metrics))]
| ^^^^^^^
Metadata
Metadata
Assignees
Labels
kind/bugSomething isn't workingSomething isn't working