Prometheus & Kubernetes
Retrieve metrics from a Prometheus endpoint inside K8s.
Add Prometheus Integration as a sidecar container
We are currently updating this feature. If you have any issues configuring this integration, please contast us at support[at]middleware.io
To scrape the prometheus endpoint via Middleware Agent, You will have to add this sidecar container
in your pod:
- name: middleware-prometheus-agent image: ghcr.io/middleware-labs/mw-kube-agent:prometheus-integration imagePullPolicy: Always env: - name: MW_TARGET value: https://xxxxx.middleware.io:443 # Middleware Target URL - name: MW_API_KEY value: "<MW_API_KEY>" # Middleware API Key - name: PROMETHEUS_SCRAPE_CONFIG value: [email protected]:8889,[email protected]:8890
Understanding Environment Variables
MW_TARGET : Specifies the target URL for the Middleware service. This URL defines the endpoint where your application should interact with the middleware.
Example Value : https://xxxxx.middleware.io:443
MW_API_KEY : Provides the API key required for authenticating with the Middleware service. Ensure the key is kept confidential and only shared with authorized users or services.
Example Value : "<MW_API_KEY>"
PROMETHEUS_SCRAPE_CONFIG : Configures Prometheus scraping targets. This variable should be set in the format 'job@address:port', where 'job' represents the scraping job name, 'address' is the IP address or hostname, and 'port' is the port to scrape metrics from.
Example Value : [email protected]:8889,[email protected]:8890
Visualize Your Prometheus Metrics
You can now access this metrics data under our Dashboard builder
https://app.middleware.io/reports
- Create a new report
- 'Add New Widget' in the report.
- Select "prometheus" under the "Data Source" dropdown as shown in the screenshot below. You will be able to see a list of your metrics.
These metrics can be visualized using various widget types, such as Timeseries, Bar Chart, Pie Chart, and more.
Troubleshooting
Missing Integrations Menu
If you do not see the Integrations Menu in Middlware, that means your account has not been granted Installation
permissions. Contact your system administrator to add the Installation
permission to your user role in Settings.
Next Steps
- How to Create Alerts
- Dashboard Basics & Customization
- Custom Telemetry Ingestion
- Getting Started With Real User Monitoring (RUM)
- Data Ingestion APIs
Need assistance or want to learn more about Middleware? Contact our support team in Slack.