Struct appinsights::TelemetryContext [−][src]
pub struct TelemetryContext { /* fields omitted */ }
Expand description
Encapsulates contextual data common to all telemetry submitted through a telemetry client.
Examples
use appinsights::telemetry::{ContextTags, Properties};
use appinsights::TelemetryContext;
let mut properties = Properties::default();
properties.insert("Resource Group".to_string(), "my-rg".to_string());
let mut tags = ContextTags::default();
tags.insert("account_id".to_string(), "123-345-777".to_string());
let context = TelemetryContext::new("instrumentation".to_string(), tags, properties);
assert_eq!(context.properties().get("Resource Group"), Some(&"my-rg".to_string()));
assert_eq!(context.tags().get("account_id"), Some(&"123-345-777".to_string()));
Implementations
Creates a new instance of telemetry context from config
Creates a new instance of telemetry context.
Returns mutable reference to a collection of common properties to attach to telemetry event.
Returns immutable reference to a collection of common properties to attach to telemetry event.
Returns mutable reference to a collection of common tags to attach to telemetry event.
Returns immutable reference to a collection of common tags to attach to telemetry event.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TelemetryContext
impl Send for TelemetryContext
impl Sync for TelemetryContext
impl Unpin for TelemetryContext
impl UnwindSafe for TelemetryContext
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more