This message was deleted.
# support
s
This message was deleted.
m
@Pranay
p
I see. I don't have much idea on alert setup. I wil need to check with another team mate and get back to you in few hrs. This should be possible as far as I understand
m
Thanks.
p
Hey @Michael Slavitch! You can use
absent
function for the expression.
Copy code
absent(up{job="otel-collector"})
m
Doesn't seem to work.
It never fires.
This does: I think it's a bug
Copy code
alert: Host Down Generic
        expr:  absent(up{job="otel-collector", host_name="*"})
        for: 1m
        labels:
            severity: critical
        annotations:
            summary: Host Down
            description: "RPS is > 100
			 VALUE = {{ $value }}
			 LABELS = {{ $labels }}"
p
You can use this alert and bring down OtelCollector to simulate the HostDown scenerio:
Copy code
alert: Host_Down_Generic
expr: absent(up{job="otel-collector"})
for: 0m
labels:
severity: critical
annotations:
  summary: Host Down
  description: "Host Down
			 VALUE = {{ $value }}
			 LABELS = {{ $labels }}"
All the alerts of 5 minutes are grouped to be sent together.
m
I did, it doesn't work unless I add host_name="*"
Then it works great and adds the host_name label to the message.
No wait it's still broken it doesn't give me the proper host.
Strange.
It requires the host_name in the query to fire
alert: Host Down Generic expr: absent(up{job="otel-collector", host_name="cyclops"}) for: 1m labels: severity: critical annotations: summary: Host Down description: "Host is down: VALUE = {{ $value }} LABELS = {{ $labels }}"
p
Oh, I see.. let me validate the same. I also use
hostname=""
for the SigNoz Otel.. while I set the hostname to the machine hostname with hostmetrics integration for specific alert,. I use
hostname!=""
for generic Otel down
m
The editor doesn't accept hostname=""
Empty string
One more question. Is there a way to add an alert via a yaml file?