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

[exporter/alertmanager] Support Log signal #35072

Open
antonjim-te opened this issue Sep 9, 2024 · 4 comments
Open

[exporter/alertmanager] Support Log signal #35072

antonjim-te opened this issue Sep 9, 2024 · 4 comments
Labels
enhancement New feature or request exporter/alertmanager help wanted Extra attention is needed Stale

Comments

@antonjim-te
Copy link

antonjim-te commented Sep 9, 2024

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

  • The severity could behave like in the traces:

    • If severity_attribute exists, use this as severity
    • If log. severityText exists, use this as severity
    • If log. severityNumber exists, use this as severity
    • Else use default severity from the config.
  • We could also get the resource attributes and convert them into annotations in the Prometheus Alert.

Additional context

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

@antonjim-te antonjim-te added enhancement New feature or request needs triage New item requiring triage labels Sep 9, 2024
Copy link
Contributor

github-actions bot commented Sep 9, 2024

Pinging code owners:

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

@sokoide
Copy link
Member

sokoide commented Sep 18, 2024

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

@sokoide
Copy link
Member

sokoide commented Sep 18, 2024

/label help-wanted -needs-triage

@github-actions github-actions bot added help wanted Extra attention is needed and removed needs triage New item requiring triage labels Sep 18, 2024
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter/alertmanager help wanted Extra attention is needed Stale
Projects
None yet
Development

No branches or pull requests

2 participants