bevy_telemetry 0.1.0

bevy swarm diagnostic, event, metric, and telemetry client
Documentation
# bevy_fleet 🌍📐📊

[![test](https://github.com/aberration-technology/bevy_fleet/workflows/test/badge.svg)](https://github.com/aberration-technology/bevy_fleet/actions?query=workflow%3Atest)
[![License](https://img.shields.io/github/license/aberration-technology/bevy_fleet)](https://github.com/aberration-technology/bevy_fleet)
[![crates.io](https://img.shields.io/crates/v/bevy_fleet.svg)](https://crates.io/crates/bevy_fleet)


bevy [fleet](https://fleet.aberration.technology) plugin, see the [demo dashboard](https://fleet.aberration.technology/demo) for live telemetry.


## install

```bash
cargo add bevy_fleet
# or Cargo.toml
# bevy_fleet = "0.1"
```


### optional features

- `git-version` - embed git metadata in every payload
- `sysinfo_plugin` - tap Bevy's system info diagnostics
- `bevy_render` - include GPU / adapter details


## what you get

- [x] bevy plugin with async publisher (tokio runtime, never blocks main thread)
- [x] automatic capture of diagnostics + metrics + machine info
- [x] tracing-friendly event collector and panic hook
- [x] production-grade OTLP exporter (official OpenTelemetry pipeline)
- [x] test companion server for local dev (`cargo run -p bevy_fleet_test_server`)
- [x] managed and self-hosted dashboards
- [x] wasm support
- [ ] network diagnostics plugin (e.g. latency, packet loss)
- [ ] authentication
- [ ] fleet performance optimization (e.g. graphics settings tuning)
- [ ] register asset load failure events
- [ ] register render pipeline events (e.g. validation error)


## usage

```rust
use bevy::prelude::*;
use bevy::diagnostic::FrameTimeDiagnosticsPlugin;
use bevy_fleet::{FleetPlugin, FleetConfig};

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(FrameTimeDiagnosticsPlugin)
        .add_plugins(FleetPlugin {
            config: FleetConfig {
                app_id: "example".into(),
                ..Default::default()
            },
        })
        .run();
}
```

### emitting events

Use Bevy's message API to write Fleet events from any system:

```rust
use bevy::prelude::*;
use bevy_fleet::FleetEvent;

fn track_player_kill(mut events: MessageWriter<FleetEvent>) {
    events.write(
        FleetEvent::new("player.kill")
            .with_data("weapon", "rocket_launcher")
            .with_data("map", "de_dust2"),
    );
}
```


## telemetry payload (json)

```json
{
  "app_id": "example",
  "timestamp": 1760840585,
  "session_id": "session-68f44a99-ce4-27c87004",
  "session_stats": {
    "payloads_published": 12,
    "metrics_collected": 72,
    "diagnostics_recorded": 120
  },
  "machine_info": { "os": "Windows", "cpu_count": 16, "total_memory_bytes": 102757092557 },
  "metrics": [{ "name": "fps.value", "value": 60.10 }],
  "diagnostics": [{ "name": "frame_time.smoothed", "value": "16.63" }],
  "events": [],
  "panics": []
}
```

- metrics carry numeric values (ideal for dashboards)
- diagnostics keep smoothed + history metadata (no duplication)
- events + panics stream through tracing-friendly collectors


## examples

- `basic` – minimal setup, custom metric
- `advanced` – event tracking + custom diagnostics
- `test_server` – local telemetry viewer (`cargo run -p bevy_fleet_test_server --bin test_server`)

```bash
# start companion server
cargo run -p bevy_fleet_test_server --bin test_server

# in another terminal
cargo run --example basic
```


## bevy support

| `bevy_fleet` | `bevy` |
| :--          | :--    |
| `0.1`        | `0.17` |


## license

licensed under either of

- Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (http://opensource.org/licenses/MIT)

at your option.


## contribution

unless you say otherwise, any contribution submitted for inclusion in the project is dual-licensed as above.