Replies: 2 comments 4 replies
-
I am not familiar with how EC2 works, but Prometheus uses keepalive to keep the HTTP connection to the targets. I expect that when you change security rules, it does not kill the existing connections. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Are you doing natting or redirecting with the security rule? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
First time writing here, if there are any guidelines I'm not following let me know and I'll edit my post
I'm using a Prometheus docker container to scan my EC2 instances based on tags and I've discovered an issue I'm not sure how to resolve
If there is no security rule for a specified port when Prometheus is launched - the instance is marked as down
If a security rule for the specified port is added after the instance was marked down and Prometheus is already running - the instance is marked as up
However, if Prometheus is running and the instance is marked as up and the security rule for the specified port is removed, the instance is still marked as up and nothing is showing up on the Prometheus logs, even in debug
I tested this with v2.21.0, v2.22.0 and v2.30.2 official docker containers, all produced the same results
Here's my configuration file
`global:
scrape_interval: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
rule_files:
scrape_configs:
#############################################################################
EC2 Node Exporter Discovery
#############################################################################
metrics_path: '/metrics'
scheme: 'http'
ec2_sd_configs:
profile: arn:aws:iam::XxXxXxXxX:role/DefaultInstance
port: 9500
filters:
values:
values:
relabel_configs:
target_label: Alert
target_label: Hostname
target_label: Environment
target_label: ServiceType
target_label: InstanceID
target_label: PublicDNSName
target_label: ElastiIP
target_label: ram_check
replacement: 'intensive'
target_label: cpu_check
replacement: 'intensive'
#############################################################################`
Here's a screen shot of the issue and cURL output from a shell
cURL output
Thanks
Beta Was this translation helpful? Give feedback.
All reactions