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

Error while transformation OpsGenie Alertmanager Config #968

Closed
deB4SH opened this issue Jun 4, 2024 · 4 comments
Closed

Error while transformation OpsGenie Alertmanager Config #968

deB4SH opened this issue Jun 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@deB4SH
Copy link

deB4SH commented Jun 4, 2024

Hi all,
I'm currently running into an issue with the operator and a opsgenie alertmanager configuration.
Currently stuck while transforming the AlertmanagerConfig to a VMAlertmanagerConfig through the operator. I want to transform the following

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: opsgenie-alertmanager
  namespace: victoria-metrics
spec:
  route:
    groupBy: ["alertname"]
    groupWait: 30s
    groupInterval: 1m
    repeatInterval: 1m
    receiver: "opsgenie"
    matchers:
      - name: rabbitmq_severity
        matchType: =
        value: critical
  receivers:
    - name: 'opsgenie'
      opsgenieConfigs:
        - apiURL: "https://api.eu.opsgenie.com/v2/alerts"
          apiKey:
            name: "opsgenie-config"
            key: "apiSecret"
          sendResolved: true
          updateAlerts: true
          responders:
            - id:  "team-x"
              name: "team-x"
              type: "team"
          httpConfig:
            proxyURL: "http://127.0.0.1:3128"

Sadly it's not working as expected and I'm greeted with an error within the operator.

{
    "level": "error",
    "ts": "2024-06-04T12:28:20Z",
    "logger": "controller",
    "msg": "cannot convert alertmanager config at update",
    "kind": "vmAlertmanagerConfig",
    "name": "opsgenie-alertmanager",
    "ns": "victoria-metrics",
    "error": "cannot convert prometheus alertmanager config: opsgenie-alertmanager into vm, err: cannot parse serialized prometheus receievers: - name: opsgenie\n  opsgenieconfigs:\n  - sendresolved: true\n    apikey:\n      localobjectreference:\n        name: opsgenie-config\n      key: apiSecret\n      optional: null\n    apiurl: https://api.eu.opsgenie.com/v2/alerts\n    message: \"\"\n    description: \"\"\n    source: \"\"\n    tags: \"\"\n    note: \"\"\n    priority: \"\"\n    updatealerts: true\n    details: []\n    responders:\n    - id: team-x\n      name: team-x\n      username: \"\"\n      type: team\n    httpconfig:\n      authorization: null\n      basicauth: null\n      oauth2: null\n      bearertokensecret: null\n      tlsconfig: null\n      proxyurl: http://127.0.0.1:3128\n      followredirects: null\n    entity: \"\"\n    actions: \"\"\n  pagerdutyconfigs: []\n  discordconfigs: []\n  slackconfigs: []\n  webhookconfigs: []\n  wechatconfigs: []\n  emailconfigs: []\n  victoropsconfigs: []\n  pushoverconfigs: []\n  snsconfigs: []\n  telegramconfigs: []\n  webexconfigs: []\n  msteamsconfigs: []\n, err: yaml: unmarshal errors:\n  line 17: cannot unmarshal !!seq into map[string]string",
    "stacktrace": "github.com/VictoriaMetrics/operator/controllers.(*ConverterController).UpdateAlertmanagerConfig\n\tgithub.com/VictoriaMetrics/operator/controllers/vmprometheusconverter_controller.go:498\nk8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnUpdate\n\tk8s.io/client-go@v12.0.0+incompatible/tools/cache/controller.go:250\nk8s.io/client-go/tools/cache.(*processorListener).run.func1\n\tk8s.io/client-go@v12.0.0+incompatible/tools/cache/shared_informer.go:971\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\tk8s.io/apimachinery@v0.29.2/pkg/util/wait/backoff.go:226\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\tk8s.io/apimachinery@v0.29.2/pkg/util/wait/backoff.go:227\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tk8s.io/apimachinery@v0.29.2/pkg/util/wait/backoff.go:204\nk8s.io/apimachinery/pkg/util/wait.Until\n\tk8s.io/apimachinery@v0.29.2/pkg/util/wait/backoff.go:161\nk8s.io/client-go/tools/cache.(*processorListener).run\n\tk8s.io/client-go@v12.0.0+incompatible/tools/cache/shared_informer.go:967\nk8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1\n\tk8s.io/apimachinery@v0.29.2/pkg/util/wait/wait.go:72"
}

Following down the exception it seems that the operator runs into an issue handling the details block. line 17: cannot unmarshal !!seq into map[string]string"

- name: opsgenie
  opsgenieconfigs:
  - sendresolved: true
    apikey:
      localobjectreference:
        name: opsgenie-config
      key: apiSecret
      optional: null
    apiurl: https://api.eu.opsgenie.com/v2/alerts
    message: \"\"
    description: \"\"
    source: \"\"
    tags: \"\"
    note: \"\"
    priority: \"\"
    updatealerts: true
    details: []
    responders:
    - id: team-x
      name: team-x
      username: \"\"
      type: team
    httpconfig:
      authorization: null
      basicauth: null
      oauth2: null
      bearertokensecret: null
      tlsconfig: null
      proxyurl: http://127.0.0.1:3128
      followredirects: null
    entity: \"\"
    actions: \"\"
  pagerdutyconfigs: []
  discordconfigs: []
  slackconfigs: []
  webhookconfigs: []
  wechatconfigs: []
  emailconfigs: []
  victoropsconfigs: []
  pushoverconfigs: []
  snsconfigs: []
  telegramconfigs: []
  webexconfigs: []
  msteamsconfigs: []

Is that a known bug?

@Haleygo
Copy link
Contributor

Haleygo commented Jun 5, 2024

Thanks for reporting, the fix will be released in next release soon.

@deB4SH
Copy link
Author

deB4SH commented Jun 5, 2024

Thanks for the quick fix. Is there a schedule for the next release?

@Haleygo
Copy link
Contributor

Haleygo commented Jun 6, 2024

Thanks for the quick fix. Is there a schedule for the next release?

No ETA yet, but roughly next week.

@f41gh7
Copy link
Collaborator

f41gh7 commented Jun 11, 2024

Changes was included to v0.45.0 release.

@f41gh7 f41gh7 closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants