Description
Component(s)
exporter/alertmanager
Is your feature request related to a problem? Please describe.
The issue #23569 and PR #28906 implemented the first version of the alertmanager exporter to alert to Alert Manager from OTEL traces (e.g. trace events).
This items is to extend it to support OTEL logs or log events because the data model is now stable.
Describe the solution you'd like
The current alertmanager exporter only supports traces as input.
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/release/v0.112.x/exporter/alertmanagerexporter/factory.go#L25
func NewFactory() exporter.Factory {
return exporter.NewFactory(
metadata.Type,
createDefaultConfig,
exporter.WithTraces(createTracesExporter, metadata.TracesStability))
}
The proposal is to support logs like exporter.WithLogs(createLogsExporter, metadata.LogsStability)
which set up the internal pipeline for logs.
Same as Trace event based alerting, alert condition is configured by another processor (e.g. transformprocessor). Logs after filtered by the processor go into the alertmanager (or alertmanager/2) pipeline which exports them to alertmanager.
Use the same exporter config as the current one. May need other fields to define what other labels (model.LabelSet
) to be sent.
exporters:
alertmanager:
generator_url: "otelcol.example.com:4317"
endpoint: "http://alertmanager.example.com:12345"
severity: "info"
severity_attribute: "severity"
tls:
insecure: true
timeout: 1s
sending_queue:
enabled: true
num_consumers: 2
queue_size: 10
retry_on_failure:
enabled: true
initial_interval: 10s
max_interval: 10s
max_elapsed_time: 10s
Describe alternatives you've considered
No response
Additional context
No response