Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

influxdb2otel receiver #1760

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Main (unreleased)

- Add `otelcol.receiver.solace` component to receive traces from a Solace broker. (@wildum)

- Added InfluxDB receiver that converts influx metric into OTEL. (@EHSchmitt4395)
### Enhancements

- Add second metrics sample to the support bundle to provide delta information (@dehaansa)
Expand Down Expand Up @@ -81,7 +82,7 @@ v1.5.0
- Add support for relative paths to `import.file`. This new functionality allows users to use `import.file` blocks in modules
imported via `import.git` and other `import.file`. (@wildum)

- `prometheus.exporter.cloudwatch`: The `discovery` block now has a `recently_active_only` configuration attribute
- `prometheus.exporter.cloudwatch`: The `discovery` block now has a `recently_active_only` configuration attribute
to return only metrics which have been active in the last 3 hours.

- Add Prometheus bearer authentication to a `prometheus.write.queue` component (@freak12techno)
Expand All @@ -94,9 +95,9 @@ v1.5.0

- Fixed a bug in `import.git` which caused a `"non-fast-forward update"` error message. (@ptodev)

- Do not log error on clean shutdown of `loki.source.journal`. (@thampiotr)
- Do not log error on clean shutdown of `loki.source.journal`. (@thampiotr)

- `prometheus.operator.*` components: Fixed a bug which would sometimes cause a
- `prometheus.operator.*` components: Fixed a bug which would sometimes cause a
"failed to create service discovery refresh metrics" error after a config reload. (@ptodev)

### Other changes
Expand Down Expand Up @@ -135,7 +136,7 @@ v1.4.3

- `pyroscope.scrape` no longer tries to scrape endpoints which are not active targets anymore. (@wildum @mattdurham @dehaansa @ptodev)

- Fixed a bug with `loki.source.podlogs` not starting in large clusters due to short informer sync timeout. (@elburnetto-intapp)
- Fixed a bug with `loki.source.podlogs` not starting in large clusters due to short informer sync timeout. (@elburnetto-intapp)

- `prometheus.exporter.windows`: Fixed bug with `exclude` regular expression config arguments which caused missing metrics. (@ptodev)

Expand All @@ -154,7 +155,7 @@ v1.4.2
- Fix parsing of the Level configuration attribute in debug_metrics config block
- Ensure "optional" debug_metrics config block really is optional

- Fixed an issue with `loki.process` where `stage.luhn` and `stage.timestamp` would not apply
- Fixed an issue with `loki.process` where `stage.luhn` and `stage.timestamp` would not apply
default configuration settings correctly (@thampiotr)

- Fixed an issue with `loki.process` where configuration could be reloaded even if there
Expand Down Expand Up @@ -195,7 +196,6 @@ v1.4.0
- (_Experimental_) Add an `otelcol.processor.interval` component to aggregate metrics and periodically
forward the latest values to the next component in the pipeline.


### Enhancements

- Clustering peer resolution through `--cluster.join-addresses` flag has been
Expand Down
1 change: 1 addition & 0 deletions docs/sources/reference/compatibility/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ The following components, grouped by namespace, _consume_ OpenTelemetry `otelcol
- [otelcol.processor.transform](../components/otelcol/otelcol.processor.transform)
- [otelcol.receiver.datadog](../components/otelcol/otelcol.receiver.datadog)
- [otelcol.receiver.file_stats](../components/otelcol/otelcol.receiver.file_stats)
- [otelcol.receiver.influxdb](../components/otelcol/otelcol.receiver.influxdb)
- [otelcol.receiver.jaeger](../components/otelcol/otelcol.receiver.jaeger)
- [otelcol.receiver.kafka](../components/otelcol/otelcol.receiver.kafka)
- [otelcol.receiver.loki](../components/otelcol/otelcol.receiver.loki)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
canonical: https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.receiver.influxdb/
description: Learn about otelcol.receiver.influxdb
title: otelcol.receiver.influxdb
---

# otelcol.receiver.influxdb

{{< docs/shared lookup="stability/experimental.md" source="alloy" version="<ALLOY_VERSION>" >}}

`otelcol.receiver.influxdb` receives InfluxDB metrics, converts them into OpenTelemetry (OTEL) format, and forwards them to other otelcol.* components over the network.

You can specify multiple `otelcol.receiver.influxdb` components by giving them different labels.

## Usage

```alloy
otelcol.receiver.influxdb "influxdb_metrics" {
endpoint = "localhost:8086" // InfluxDB metrics ingestion endpoint

output {
metrics = [...]
}
}
```

## Arguments

`otelcol.receiver.influxdb` supports the following arguments:

| Name | Type | Description | Default | Required |
| -------------------- | -------------- | ---------------------------------------------------------------- | ------------------ | -------- |
| `endpoint` | `string` | `host:port` to listen for traffic on. | `"localhost:8086"` | no |
EHSchmitt4395 marked this conversation as resolved.
Show resolved Hide resolved


By default, `otelcol.receiver.influxdb` listens for HTTP connections on `localhost`.
To expose the HTTP server to other machines on your network, configure `endpoint` with the IP address to listen on, or `0.0.0.0:8086` to listen on all network interfaces.

## Blocks

The following blocks are supported inside the definition of `otelcol.receiver.influxdb`:

Hierarchy | Block | Description | Required
--------- | ----- | ----------- | --------
tls | [tls][] | Configures TLS for the HTTP server. | no
cors | [cors][] | Configures CORS for the HTTP server. | no
debug_metrics | [debug_metrics][] | Configures the metrics that this component generates to monitor its state. | no
output | [output][] | Configures where to send received traces. | yes

The `>` symbol indicates deeper levels of nesting. For example, `grpc > tls`
refers to a `tls` block defined inside a `grpc` block.

[tls]: #tls-block
[cors]: #cors-block
[debug_metrics]: #debug_metrics-block
[output]: #output-block

### tls block

The `tls` block configures TLS settings used for a server. If the `tls` block
isn't provided, TLS won't be used for connections to the server.

{{< docs/shared lookup="reference/components/otelcol-tls-server-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

### cors block

The `cors` block configures CORS settings for an HTTP server.

The following arguments are supported:

Name | Type | Description | Default | Required
---- | ---- | ----------- | ------- | --------
`allowed_origins` | `list(string)` | Allowed values for the `Origin` header. | | no
`allowed_headers` | `list(string)` | Accepted headers from CORS requests. | `["X-Requested-With"]` | no
`max_age` | `number` | Configures the `Access-Control-Max-Age` response header. | | no

The `allowed_headers` argument specifies which headers are acceptable from a
CORS request. The following headers are always implicitly allowed:

* `Accept`
* `Accept-Language`
* `Content-Type`
* `Content-Language`

If `allowed_headers` includes `"*"`, all headers are permitted.

### debug_metrics block

{{< docs/shared lookup="reference/components/otelcol-debug-metrics-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

### output block

{{< docs/shared lookup="reference/components/output-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Exported fields

`otelcol.receiver.influxdb` doesn't export any fields.

## Component health

`otelcol.receiver.influxdb` is only reported as unhealthy if given an invalid configuration.

## Debug information

`otelcol.receiver.influxdb` doesn't expose any component-specific debug information.

## Example

This example forwards received telemetry to Prometheus Remote Write (Mimir):

```alloy
otelcol.receiver.influxdb "influxdb_metrics" {
endpoint = "localhost:8086" // InfluxDB metrics ingestion endpoint

output {
metrics = [otelcol.exporter.prometheus.influx_output.input] // Forward metrics to Prometheus exporter
}
}

otelcol.exporter.prometheus "influx_output" {
forward_to = [prometheus.remote_write.mimir.receiver] // Forward metrics to Prometheus remote write (Mimir)
}

prometheus.remote_write "mimir" {
endpoint {
url = "https://prometheus-prod-13-prod-us-east-0.grafana.net/api/prom/push"

basic_auth {
username = "xxxxx"
password = "xxxx=="
}
}
}
```

This example forwards received telemetry through a batch processor before finally sending it to an OTLP-capable endpoint:


```alloy
otelcol.receiver.influxdb "influxdb_metrics" {
endpoint = "localhost:8086" // InfluxDB metrics ingestion endpoint

output {
metrics = [ootelcol.processor.batch.default.input]
}
}


otelcol.processor.batch "default" {
output {
metrics = [otelcol.exporter.otlp.default.input]
}
}

otelcol.exporter.otlp "default" {
client {
endpoint = sys.env("OTLP_ENDPOINT")
}
}
```

<!-- START GENERATED COMPATIBLE COMPONENTS -->

## Compatible components

`otelcol.receiver.influxdb` can accept arguments from the following components:

- Components that export [OpenTelemetry `otelcol.Consumer`](../../../compatibility/#opentelemetry-otelcolconsumer-exporters)


{{< admonition type="note" >}}
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly.
Refer to the linked documentation for more details.
{{< /admonition >}}

<!-- END GENERATED COMPATIBLE COMPONENTS -->
12 changes: 12 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -822,14 +822,26 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

require (
github.com/influxdata/influxdb-client-go/v2 v2.14.0
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver v0.112.0
)

require (
github.com/Azure/go-amqp v1.2.0 // indirect
github.com/DataDog/datadog-agent/comp/core/log/def v0.57.1 // indirect
github.com/antchfx/xmlquery v1.4.2 // indirect
github.com/antchfx/xpath v1.3.2 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/ebitengine/purego v0.8.0 // indirect
github.com/elastic/lunes v0.1.0 // indirect
github.com/influxdata/influxdb-observability/common v0.5.12 // indirect
github.com/influxdata/influxdb-observability/influx2otel v0.5.12 // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/influxdata/line-protocol/v2 v2.2.1 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/kafka/topic v0.112.0 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
go.opentelemetry.io/collector/connector/connectorprofiles v0.112.0 // indirect
Expand Down
Loading