Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test ExternalLabels
We test our ExternalLabels by sending metrics to a RemoteWrite endpoint and ensuring ExternalLabels defined on the MonitoringStack Operator exist in the metrics. We will deploy a custom Blue App, that has an endpoint
/alerts
that receives metrics. We can verify ExternalLabels are working by checking the logs of the Blue App.Setup Kind Cluster
To setup kind cluster, read the README.md
Deploy Blue Application
Deploy MSO
We have defined our ExternalLabels and the RemoteWrite Endpoint.
Deploy ServiceMonitor
Tell Prometheus to Scrape the Blue App
Verify ExternalLabels exist in RemoteWrite Metrics
Since Prometheus has been instruected to send RemoteWrite metrics to the blue app, we can check the logs of the blue app to ensure that the ExternalLabels we defined are present:
tenant_id
,user
, andclusterID
output
Clean Up