heph icon indicating copy to clipboard operation
heph copied to clipboard

New Observer type

Open Thomasdezeeuw opened this issue 6 years ago • 5 comments

This Observer allows metrics to be exported, including but not limited to:

  • Actor version.
  • Application version.
  • Target, e.g. x86_64-apple-darwin?
  • Number of processes used.
  • Memory usage.
  • Uptime, total time running since start.
  • Number of processes (actors, initiators and tasks).
  • Number of processes ready to run.
  • Maybe expose a process list; ProcessId, name (?) and ready state.

This is going to be hard when using a seperate process per core, rather then threads.

Thomasdezeeuw avatar Jul 27 '18 11:07 Thomasdezeeuw

This could be used by external crates to export to systems like Prometheus.

Thomasdezeeuw avatar Jul 27 '18 11:07 Thomasdezeeuw

Also need metrics from Initiators, e.g. the number of requests handled and in progress.

Thomasdezeeuw avatar Jul 27 '18 12:07 Thomasdezeeuw

Some more toughs.

An Observable which can be implemented by a types that can be observed.

pub trait Observable {
    // This would need to implement serde::Deserialise or something.
    type Metrics;

    fn observe(&self) -> Metrics;
}

For the ActorSystem (via ActorSystemRef) the metrics would be.

pub struct ActorSystemMetrics {
    active_actors: usize,
    inactive_actors: usize,
    total_actors_spawned: usize,
}

For TcpListener.

pub struct TcpListenerMetrics {
    accepted_connections: usize,
}

Thomasdezeeuw avatar Feb 02 '19 14:02 Thomasdezeeuw

Maybe support OpenTelemtry: https://opentelemetry.io/, https://github.com/open-telemetry/opentelemetry-specification.

Thomasdezeeuw avatar Apr 02 '20 09:04 Thomasdezeeuw

See https://github.com/Thomasdezeeuw/heph/pull/484.

Thomasdezeeuw avatar Sep 18 '21 11:09 Thomasdezeeuw