Skip to content

Commit

Permalink
initial pass at docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rlankfo committed Feb 20, 2024
1 parent eebaf21 commit 6a25a4f
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/sources/flow/reference/compatibility/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ The following components, grouped by namespace, _export_ OpenTelemetry `otelcol.
<!-- START GENERATED SECTION: EXPORTERS OF OpenTelemetry `otelcol.Consumer` -->

{{< collapse title="otelcol" >}}
- [otelcol.connector.grafanacloud]({{< relref "../components/otelcol.connector.grafanacloud.md" >}})
- [otelcol.connector.servicegraph]({{< relref "../components/otelcol.connector.servicegraph.md" >}})
- [otelcol.connector.spanlogs]({{< relref "../components/otelcol.connector.spanlogs.md" >}})
- [otelcol.connector.spanmetrics]({{< relref "../components/otelcol.connector.spanmetrics.md" >}})
Expand Down Expand Up @@ -309,6 +310,7 @@ The following components, grouped by namespace, _consume_ OpenTelemetry `otelcol
{{< /collapse >}}

{{< collapse title="otelcol" >}}
- [otelcol.connector.grafanacloud]({{< relref "../components/otelcol.connector.grafanacloud.md" >}})
- [otelcol.connector.servicegraph]({{< relref "../components/otelcol.connector.servicegraph.md" >}})
- [otelcol.connector.spanlogs]({{< relref "../components/otelcol.connector.spanlogs.md" >}})
- [otelcol.connector.spanmetrics]({{< relref "../components/otelcol.connector.spanmetrics.md" >}})
Expand Down
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")
}
}
}
```

0 comments on commit 6a25a4f

Please sign in to comment.