-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
docs/sources/flow/reference/components/otelcol.connector.grafanacloud.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
aliases: | ||
- /docs/grafana-cloud/monitor-infrastructure/agent/flow/reference/components/otelcol.connector.grafanacloud/ | ||
- /docs/grafana-cloud/send-data/agent/flow/reference/components/otelcol.connector.grafanacloud/ | ||
canonical: https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.connector.grafanacloud/ | ||
description: Learn about otelcol.connector.grafanacloud | ||
labels: | ||
stage: experimental | ||
title: otelcol.connector.grafanacloud | ||
--- | ||
|
||
# otelcol.connector.grafanacloud | ||
|
||
{{< docs/shared lookup="flow/stability/experimental.md" source="agent" version="<AGENT_VERSION>" >}} | ||
|
||
`otel.connector.grafanacloud` accepts span data from other `otelcol` components and generates usage | ||
metrics. | ||
|
||
## Usage | ||
|
||
```river | ||
otelcol.connector.grafanacloud "LABEL" { | ||
output { | ||
metrics = [...] | ||
} | ||
} | ||
``` | ||
|
||
## Arguments | ||
|
||
`otelcol.connector.grafanacloud` supports the following arguments: | ||
|
||
| Name | Type | Description | Default | Required | | ||
| ------------------------ | -------------- | ------------------------------------------------------------------ | ------------- | -------- | | ||
| `host_identifiers` | `list(string)` | Ordered list of resource attributes used to identify unique hosts. | `["host.id"]` | no | | ||
| `metrics_flush_interval` | `duration` | How often to flush generated metrics. | `"60s"` | no | | ||
|
||
## Exported fields | ||
|
||
The following fields are exported and can be referenced by other components: | ||
|
||
| Name | Type | Description | | ||
| ------- | ------------------ | ---------------------------------------------------------------- | | ||
| `input` | `otelcol.Consumer` | A value that other components can use to send telemetry data to. | | ||
|
||
`input` accepts `otelcol.Consumer` traces telemetry data. It does not accept metrics and logs. | ||
|
||
## Example | ||
|
||
The example below accepts traces, adds the `host.id` resource attribute via the `otelcol.processor.resourcedetection` component, | ||
creates usage metrics from these traces, and writes the metrics to Mimir. | ||
|
||
```river | ||
otelcol.receiver.otlp "otlp" { | ||
http {} | ||
grpc {} | ||
output { | ||
traces = [otelcol.processor.resourcedetection.otlp_resources.input] | ||
} | ||
} | ||
otelcol.processor.resourcedetection "otlp_resources" { | ||
detectors = ["system"] | ||
system { | ||
hostname_sources = [ "os" ] | ||
resource_attributes { | ||
host.id { | ||
enabled = true | ||
} | ||
} | ||
} | ||
output { | ||
traces = [otelcol.connector.grafanacloud.default.input] | ||
} | ||
} | ||
otelcol.connector.grafanacloud "default" { | ||
output { | ||
metrics = [otelcol.exporter.prometheus.otlp_metrics.input] | ||
} | ||
} | ||
otelcol.exporter.prometheus "otlp_metrics" { | ||
forward_to = [prometheus.remote_write.default.receiver] | ||
} | ||
prometheus.remote_write "default" { | ||
endpoint { | ||
url = "https://prometheus-xxx.grafana.net/api/prom/push" | ||
basic_auth { | ||
username = env("PROMETHEUS_USERNAME") | ||
password = env("GRAFANA_CLOUD_API_KEY") | ||
} | ||
} | ||
} | ||
``` |