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

question: VM Operator Rules uses externalURL as Grafana Hostname? #1244

Closed
yukha-dw opened this issue Feb 25, 2025 · 4 comments
Closed

question: VM Operator Rules uses externalURL as Grafana Hostname? #1244

yukha-dw opened this issue Feb 25, 2025 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@yukha-dw
Copy link

This looks like a typo? As my understanding  $externalURL refers to external VM Alertmanager, not Grafana.

dashboard: "{{ $externalURL }}/d/1H179hunk/victoriametrics-operator?ds={{ $labels.dc }}&orgId=1&viewPanel=16"

It'd be nice if we can configure this or just use default localhost:3000 just like alerts on VictoriaMetrics/VictoriaMetrics
, so hack script on helm chart can generate proper URL
https://github.com/VictoriaMetrics/helm-charts/blob/1eab4633d78a1b7f173e925549beba2b2ad5d9d1/hack/rules-and-dashboards/sync_rules.py#L180-L183

@Haleygo
Copy link
Contributor

Haleygo commented Feb 25, 2025

The annotation dashboard is meant to link to the vm-operator dashboard in Grafana. And in this case, you should set -external.url in vmalert as the grafana address. But this is just an example, as the dashboard id also changes in different setups.
Feel free to modify the annotation if it doesn’t work for your case.

@Haleygo Haleygo added the question Further information is requested label Feb 25, 2025
@yukha-dw
Copy link
Author

@Haleygo I see, thank you for you explanation. So what i need to do is setup this, right?

vmalert:
  spec:
    extraArgs:
      external.url: "external.grafana.domain"

@Haleygo
Copy link
Contributor

Haleygo commented Feb 25, 2025

@Haleygo I see, thank you for you explanation. So what i need to do is setup this, right?

vmalert:
  spec:
    extraArgs:
      external.url: "external.grafana.domain"

Yep.
Please note, the dashboard id 1H179hunk also needs to be updated with the value in your granfana. If you don't want to change it for every setup, you can also add an annotation to use the grafana Explore as:

query: "{{ $externalURL }}/explore?left={"datasource":"VictoriaMetrics","queries":[{"expr":{{ .Expr|jsonEscape|queryEscape }},"refId":"A"}],"range":{"from":"{{ .ActiveAt.UnixMilli }}","to":"now"}}" 

Or you can just use it as the alert source, see this doc.

@Haleygo Haleygo self-assigned this Feb 25, 2025
@yukha-dw yukha-dw changed the title bug: VM Operator Rules uses externalURL as Grafana Hostname? question: VM Operator Rules uses externalURL as Grafana Hostname? Feb 26, 2025
@yukha-dw
Copy link
Author

yukha-dw commented Feb 26, 2025

@Haleygo got it, thank you for your help!

Update: adding args above fix the issue, but Source Link on alert will refer to Grafana too 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants