Skip to main content

VCLPrometheusExporter

Struct VCLPrometheusExporter 

Source
pub struct VCLPrometheusExporter { /* private fields */ }
Expand description

Prometheus metrics exporter for VCL Protocol.

Exposes all VCL metrics in Prometheus text format, ready to be scraped by a Prometheus server.

Implementations§

Source§

impl VCLPrometheusExporter

Source

pub fn new() -> Result<Self, VCLError>

Create a new exporter with its own Prometheus registry.

Source

pub fn update_bytes_sent(&self, bytes: u64)

Record bytes sent.

Source

pub fn update_bytes_received(&self, bytes: u64)

Record bytes received.

Source

pub fn update_packets_sent(&self, count: u64)

Record packets sent.

Source

pub fn update_packets_received(&self, count: u64)

Record packets received.

Source

pub fn update_retransmit(&self)

Record a retransmission.

Source

pub fn update_dropped(&self, count: u64)

Record dropped packets.

Source

pub fn set_connections_active(&self, count: f64)

Set active connection count.

Source

pub fn update_reconnect(&self)

Record a reconnect.

Source

pub fn update_handshake(&self)

Record a handshake.

Source

pub fn update_key_rotation(&self)

Record a key rotation.

Source

pub fn set_loss_rate(&self, rate: f64)

Set current loss rate.

Source

pub fn set_rtt_seconds(&self, rtt: f64)

Set current RTT in seconds.

Source

pub fn set_cwnd(&self, cwnd: f64)

Set current congestion window.

Source

pub fn set_obfuscation_overhead(&self, ratio: f64)

Set obfuscation overhead ratio.

Source

pub fn set_mtu(&self, mtu: u16)

Set current MTU.

Source

pub fn update_dns_queries(&self, count: u64)

Record DNS queries intercepted.

Source

pub fn update_dns_blocked(&self, count: u64)

Record DNS queries blocked.

Source

pub fn update_dns_cache_hits(&self, count: u64)

Record DNS cache hits.

Source

pub fn update_fragments_sent(&self, count: u64)

Record fragments sent.

Source

pub fn update_fragments_reassembled(&self, count: u64)

Record fragments reassembled.

Source

pub fn set_tunnel_state(&self, state: f64)

Set tunnel state (0=Stopped, 1=Connecting, 2=Connected, 3=Reconnecting, 4=Failed).

Source

pub fn update_from_metrics(&self, m: &VCLMetrics)

Update all counters from a VCLMetrics snapshot.

Counters are incremental — call this each time you want to push the delta since last call. For simplicity this resets and re-adds the full values (idempotent for Prometheus pull model).

Source

pub fn update_from_tunnel_stats(&self, stats: &TunnelStats)

Update all gauges and counters from a TunnelStats snapshot.

Source

pub fn render(&self) -> String

Render all metrics in Prometheus text exposition format.

Serve this on an HTTP endpoint (e.g. /metrics) for Prometheus to scrape.

Source

pub fn registry(&self) -> &Registry

Returns the underlying Registry for advanced use.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more