Skip to content

Commit 3d8294f

Browse files
authored
Add initial readme and update example config. (#9)
1 parent cd885c1 commit 3d8294f

3 files changed

Lines changed: 59 additions & 2 deletions

File tree

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
```

collector/config.example.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
receivers:
22
oxide:
3-
# Note: uncomment to configure Oxide API. By default, the collector uses $OXIDE_PROFILE.
3+
# Note: uncomment to configure Oxide API authentication. By default, the
4+
# collector uses the $OXIDE_{PROFILE,HOST,TOKEN} environment variables.
45
# host: ${env:OXIDE_HOST}
56
# token: ${env:OXIDE_TOKEN}
67
metric_patterns:
@@ -15,6 +16,9 @@ processors:
1516
exporters:
1617
prometheus:
1718
endpoint: "0.0.0.0:9091"
19+
translation_strategy: UnderscoreEscapingWithSuffixes
20+
resource_to_telemetry_conversion:
21+
enabled: true
1822

1923
service:
2024
telemetry:

factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func NewFactory() receiver.Factory {
2424
func createDefaultConfig() component.Config {
2525
return &Config{
2626
MetricPatterns: []string{".*"},
27-
ScrapeConcurrency: 25,
27+
ScrapeConcurrency: 16,
2828
QueryLookback: "5m",
2929
}
3030
}

0 commit comments

Comments
 (0)