Skip to content

Commit

Permalink
[collector] Update internal metrics config examples, suggest OTLP for…
Browse files Browse the repository at this point in the history
… pushing metrics

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Sep 17, 2024
1 parent 49879d0 commit 6c35006
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions content/en/docs/collector/internal-telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,23 @@ By default, the Collector exposes its own telemetry in two ways:

You can configure how internal metrics are generated and exposed by the
Collector. By default, the Collector generates basic metrics about itself and
exposes them for scraping at `http://127.0.0.1:8888/metrics`. You can expose the
endpoint to one specific or all network interfaces when needed. For
exposes them using the otel-go Prometheus exporter for scraping the at
`http://127.0.0.1:8888/metrics`. You can expose the endpoint to one specific or all network interfaces when needed. For
containerized environments, you might want to expose this port on a public
interface.

Set the address in the config `service::telemetry::metrics`:
Set the Prometheus config under `service::telemetry::metrics`:

```yaml
service:
telemetry:
metrics:
address: 0.0.0.0:8888
readers:
pull:
exporter:
prometheus:
host: "0.0.0.0"
port: 8888
```
You can adjust the verbosity of the Collector metrics output by setting the
Expand All @@ -59,30 +64,33 @@ service:
level: detailed
```

The Collector can also be configured to scrape its own metrics using a
[Prometheus receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver)
and send them through configured pipelines. For example:
The Collector can also be configured to push its own metrics to an
[OTLP receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver)
and send them through configured pipelines. In the following example,
the Collector is configured to push metrics every 10s using OTLP grpc to `localhost:8888`:

Check failure on line 70 in content/en/docs/collector/internal-telemetry.md

View workflow job for this annotation

GitHub Actions / TEXT linter

textlint terminology error

Incorrect term: “grpc”, use “gRPC” instead

```yaml
receivers:
prometheus:
config:
scrape_configs:
- job_name: 'otelcol'
scrape_interval: 10s
static_configs:
- targets: ['0.0.0.0:8888']
metric_relabel_configs:
- source_labels: [__name__]
regex: '.*grpc_io.*'
action: drop
otlp/internal_metrics:
protocols:
grpc:
endpoint: localhost:8888
exporters:
debug:
service:
pipelines:
metrics:
receivers: [prometheus]
receivers: [otlp/internal_metrics]
exporters: [debug]
telemetry:
metrics:
readers:
- periodic:
interval: 10000
exporter:
otlp/metrics-agent:
protocol: grpc/protobuf
endpoint: localhost:8888
```

{{% alert title="Caution" color="warning" %}}
Expand Down

0 comments on commit 6c35006

Please sign in to comment.