|
| 1 | +# Oxide Receiver for OpenTelemetry Collector |
| 2 | + |
| 3 | +This repository provides an OpenTelemetry Collector receiver for the Oxide. |
| 4 | + |
| 5 | +## Configuration |
| 6 | + |
| 7 | +The Oxide receiver collects metrics from the Oxide API and converts them to OpenTelemetry metrics. |
| 8 | + |
| 9 | +All configuration parameters are optional. If `host` and `token` are not provided in the configuration, the receiver will attempt to read them from the environment using the defaults [defined in the Oxide SDK](https://github.com/oxidecomputer/oxide.go#authentication). |
| 10 | + |
| 11 | +### Parameters |
| 12 | + |
| 13 | +| Parameter | Type | Default | Description | |
| 14 | +|-----------|------|---------|-------------| |
| 15 | +| `host` | string | (from environment) | The Oxide API host URL. If not specified, the Oxide SDK will read from environment variables | |
| 16 | +| `token` | string | (from environment) | Authentication token for the Oxide API. If not specified, the Oxide SDK will read from environment variables | |
| 17 | +| `metric_patterns` | []string | `[".*"]` | List of regex patterns to filter which metrics to collect. Metrics matching any pattern will be included | |
| 18 | +| `scrape_concurrency` | int | `16` | Number of concurrent requests to make when scraping metrics | |
| 19 | +| `query_lookback` | string | `"5m"` | Lookback interval for queries sent to the Oxide API (e.g., "5m", "1h") | |
| 20 | +| `add_labels` | bool | `false` | Add human-readable labels to metrics using the Oxide API | |
| 21 | +| `collection_interval` | duration | `1m` | Interval at which metrics are collected | |
| 22 | +| `initial_delay` | duration | `1s` | Initial delay before starting collection | |
| 23 | +| `timeout` | duration | `0s` | Timeout for the scraper (0 means no timeout) | |
| 24 | + |
| 25 | +### Example Configuration |
| 26 | + |
| 27 | +See [collector/config.example.yaml](collector/config.example.yaml) for a complete example configuration. |
| 28 | + |
| 29 | +## Building an Otel Collector binary |
| 30 | + |
| 31 | +This repository includes utilities to build an OpenTelemetry Collector binary that includes the `oxidereceiver`. For convenience, we also include the Otel components used in the [otelcol-contrib distribution](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) provided by the OpenTelemetry organization. To customize the set of Otel plugins used, update [collector/manifest.yaml](collector/manifest.yaml). |
| 32 | + |
| 33 | +### Building the Collector |
| 34 | + |
| 35 | +```bash |
| 36 | +make build-collector |
| 37 | +``` |
| 38 | + |
| 39 | +### Running the Collector |
| 40 | + |
| 41 | +Create a `collector/config.yaml` file with your collector configuration, or copy from collector/config.example.yaml, then run: |
| 42 | + |
| 43 | +```bash |
| 44 | +./dist/otelcol-oxide --config collector/config.yaml |
| 45 | +``` |
| 46 | + |
| 47 | +## Development |
| 48 | + |
| 49 | +### Running Tests |
| 50 | + |
| 51 | +```bash |
| 52 | +make test |
| 53 | +``` |
0 commit comments