open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.12k stars 2.39k forks source link

[exporter/alertmanager] Support Log signal #35072

Open antonjim-te opened 2 months ago

antonjim-te commented 2 months ago

Component(s)

exporter/alertmanager

Is your feature request related to a problem? Please describe.

Support Log signal in exporter/alertmanager

Describe the solution you'd like

My proposal would be to map the OpenTelemetry Log to a Prometheus Alert. For example:

{
  "resourceLogs": [
    {
      "scopeLogs": [
          "logRecords": [
            {
              "timeUnixNano": "1544712660300000000",
              "severityText": "info",
              "body": {
                "stringValue": "CPU is higher than 90%"
              },
              "attributes": [
                {
                  "key": "env",
                  "value": {
                    "stringValue": "prod"
                  }
                },
                {
                  "key": "pod_name",
                  "value": {
                    "stringValue": "service-7b8c786fdf-l9xsj"
                  }
                }
              ]
            }
          ]
      ]    
    }
  ]
}

To

{
  "startsAt": "2024-09-05T11:58:16.159Z",
  "annotations": {
    "env": "prod",
    "pod_name": "service-7b8c786fdf-l9xsj",
  },
  "labels": {
    "severity": "info",
    "event_name": "CPU is higher than 90%"
  },
  "generatorURL": "opentelemetry-collector"
}

Describe alternatives you've considered

Additional context

Thank you for reading my proposal. If I have your support, I can help contribute and implement it.

github-actions[bot] commented 2 months ago

Pinging code owners:

sokoide commented 2 months ago

Supporting OTEL (log) event makes sense although it's development now. We were going to support it when it's finalized.

sokoide commented 2 months ago

/label help-wanted -needs-triage

github-actions[bot] commented 1 week ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.