This is documentation for the next version of Alloy. For the latest stable release, go to the latest version.
otelcol.connector.host_info
otel.connector.host_info
accepts span data from other otelcol
components and generates usage metrics.
Usage
otelcol.connector.host_info "LABEL" {
output {
metrics = [...]
}
}
Arguments
otelcol.connector.host_info
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 |
Blocks
The following blocks are supported inside the definition of
otelcol.connector.host_info
:
Hierarchy | Block | Description | Required |
---|---|---|---|
output | output | Configures where to send received telemetry data. | yes |
debug_metrics | debug_metrics | Configures the metrics that this component generates to monitor its state. | no |
output block
The output
block configures a set of components to forward resulting telemetry data to.
The following arguments are supported:
Name | Type | Description | Default | Required |
---|---|---|---|---|
metrics | list(otelcol.Consumer) | List of consumers to send metrics to. | [] | no |
You must specify the output
block, but all its arguments are optional.
By default, telemetry data is dropped.
Configure the metrics
argument accordingly to send telemetry data to other components.
debug_metrics block
The debug_metrics
block configures the metrics that this component generates to monitor its state.
The following arguments are supported:
Name | Type | Description | Default | Required |
---|---|---|---|---|
disable_high_cardinality_metrics | boolean | Whether to disable certain high cardinality metrics. | true | no |
level | string | Controls the level of detail for metrics emitted by the wrapped collector. | "detailed" | no |
disable_high_cardinality_metrics
is the Grafana Alloy equivalent to the telemetry.disableHighCardinalityMetrics
feature gate in the OpenTelemetry Collector.
It removes attributes that could cause high cardinality metrics.
For example, attributes with IP addresses and port numbers in metrics about HTTP and gRPC connections are removed.
Note
If configured,disable_high_cardinality_metrics
only applies tootelcol.exporter.*
andotelcol.receiver.*
components.
level
is the Alloy equivalent to the telemetry.metrics.level
feature gate in the OpenTelemetry Collector.
Possible values are "none"
, "basic"
, "normal"
and "detailed"
.
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.
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.host_info.default.input]
}
}
otelcol.connector.host_info "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 = sys.env("PROMETHEUS_USERNAME")
password = sys.env("GRAFANA_CLOUD_API_KEY")
}
}
}
Compatible components
otelcol.connector.host_info
can accept arguments from the following components:
- Components that export OpenTelemetry
otelcol.Consumer
otelcol.connector.host_info
has exports that can be consumed by the following components:
- Components that consume OpenTelemetry
otelcol.Consumer
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.