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

Docker Compose(metrics): Metric Ingestion via Labels #49

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

qclaogui
Copy link
Owner

@qclaogui qclaogui commented Mar 14, 2024

Added support for ingesting metrics and controlling the behavior of their ingestion through labels.

The following docker compose service labels are supported:

Metrics

The following service labels are supported for gathering of metrics for docker compose services:

Label Description
metrics.agent.grafana.com/scrape
or
prometheus.io/scrape
Boolean whether or not to scrape the service for metrics (default is true).
metrics.agent.grafana.com/scheme
or
prometheus.io/scheme
The default scraping scheme is http, only support http now.
metrics.agent.grafana.com/path
or
prometheus.io/path
the default path to scrape is /metrics, this can be specified as a single value which would override, the scrape path being used for all ports attached to the target
metrics.agent.grafana.com/port
or
prometheus.io/port
the default port to scrape is the target port, this can be specified as a single value which would override the scrape port being used for all ports attached to the target, note that even if an target had multiple targets, the relabel_config targets are deduped before scraping
metrics.agent.grafana.com/tenant The tenant their metrics should be sent to, this does not necessarily have to be the actual tenantId, it can be a friendly name as well that is simply used to determine if the metrics should be gathered for the current tenant
metrics.agent.grafana.com/job
or
prometheus.io/job
The job label value to use when collecting their metrics. However, it is common to use an integration or community project where rules / dashboards are provided for you. Oftentimes, this provided assets use hard-coded values for a job label i.e. ...{job="integrations/kubernetes/cadvisor"...} or ...{job="minio-job"...} setting this annotation to that value will allow the provided asset to work out of the box.
metrics.agent.grafana.com/interval
or
prometheus.io/interval
The default interval to scrape is 15s, this can be override.
metrics.agent.grafana.com/timeout
or
prometheus.io/timeout
The default timeout for scraping is 10s, this can be override.

Logs

See: #47

@qclaogui qclaogui self-assigned this Mar 14, 2024
@qclaogui qclaogui force-pushed the metrics-ingestion-via-labels branch from 199be15 to a035789 Compare March 14, 2024 13:01
Signed-off-by: Weifeng Wang <qclaogui@gmail.com>

add metrics-labels-auto-scrape.river

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>

fix

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>

update docs

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>

code clean

Signed-off-by: Weifeng Wang <qclaogui@gmail.com>
@qclaogui qclaogui force-pushed the metrics-ingestion-via-labels branch from 2531430 to 45dcbf4 Compare March 14, 2024 13:30
@qclaogui qclaogui merged commit 090a3ba into main Mar 14, 2024
1 check passed
@qclaogui qclaogui deleted the metrics-ingestion-via-labels branch March 14, 2024 16:12
@qclaogui qclaogui removed enhancement New feature or request kind/improvement labels Mar 16, 2024
This was referenced Mar 26, 2024
This was referenced Mar 29, 2024
This was referenced Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant