Skip to content

Commit

Permalink
Added hierarchy to the metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
arapulido committed Dec 20, 2019
1 parent 4392c77 commit 87ce2c4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ instances:
## Metrics to be extracted from cert-manager
#
# metrics:
# - "certmanager_certificate_ready_status": "certificate_ready_status"
# - "certmanager_certificate_ready_status": "certificate.ready_status"
# - "<CERTMANAGER_METRIC_NAME>": "<DATADOG_METRIC_NAME>"

## @param type_overrides - list of key:value element - optional
Expand Down
10 changes: 5 additions & 5 deletions cert_manager/datadog_checks/cert_manager/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Licensed under a 3-clause BSD style license (see LICENSE)

METRIC_MAP = {
'certmanager_certificate_ready_status': 'certificate_ready_status',
'certmanager_certificate_expiration_timestamp_seconds': 'certificate_expiration_timestamp',
'certmanager_acme_client_request_count': 'acme_client_request_count',
'certmanager_acme_client_request_duration_seconds': 'acme_client_request_duration',
'certmanager_controller_sync_call_count': 'controller_sync_call_count',
'certmanager_certificate_ready_status': 'certificate.ready_status',
'certmanager_certificate_expiration_timestamp_seconds': 'certificate.expiration_timestamp',
'certmanager_acme_client_request_count': 'acme_client.request.count',
'certmanager_acme_client_request_duration_seconds': 'acme_client.request.duration',
'certmanager_controller_sync_call_count': 'controller.sync_call.count',
}
14 changes: 7 additions & 7 deletions cert_manager/metadata.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name
cert_manager.prometheus.health,gauge,,,,Whether the check is able to connect to the metrics endpoint,0,cert_manager,cm.health
cert_manager.certificate_ready_status,gauge,,,,The ready status of the certificate,0,cert_manager,cm.cert_ready_status
cert_manager.certificate_expiration_timestamp,gauge,,second,,The date after which the certificate expires. Expressed as a Unix Epoch Time,0,cert_manager,cm.cert_exp_time
cert_manager.acme_client_request_count,count,,,,The number of requests made by the ACME client,1,cert_manager,cm.acme_req_cnt
cert_manager.acme_client_request_duration.sum,gauge,,,,The sum of the HTTP request latencies in seconds for the ACME client,1,cert_manager,cm.req_duration.sum
cert_manager.acme_client_request_duration.count,gauge,,,,The count of the HTTP request latencies in seconds for the ACME client,1,cert_manager,cm.req_duration.cnt
cert_manager.acme_client_request_duration.quantile,gauge,,,,The quantiles of the HTTP request latencies in seconds for the ACME client,1,cert_manager,cm.req_duration.quant
cert_manager.controller_sync_call_count,count,,,,The number of sync() calls made by a controller,1,cert_manager,cm.sync_call_cnt
cert_manager.certificate.ready_status,gauge,,,,The ready status of the certificate,0,cert_manager,cm.cert_ready_status
cert_manager.certificate.expiration_timestamp,gauge,,second,,The date after which the certificate expires. Expressed as a Unix Epoch Time,0,cert_manager,cm.cert_exp_time
cert_manager.acme_client.request.count,count,,,,The number of requests made by the ACME client,1,cert_manager,cm.acme_req_cnt
cert_manager.acme_client.request.duration.sum,gauge,,,,The sum of the HTTP request latencies in seconds for the ACME client,1,cert_manager,cm.req_duration.sum
cert_manager.acme_client.request.duration.count,gauge,,,,The count of the HTTP request latencies in seconds for the ACME client,1,cert_manager,cm.req_duration.cnt
cert_manager.acme_client.request.duration.quantile,gauge,,,,The quantiles of the HTTP request latencies in seconds for the ACME client,1,cert_manager,cm.req_duration.quant
cert_manager.controller.sync_call.count,count,,,,The number of sync() calls made by a controller,1,cert_manager,cm.sync_call_cnt
14 changes: 7 additions & 7 deletions cert_manager/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from datadog_checks.stubs import aggregator

EXPECTED_METRICS = {
'cert_manager.certificate_ready_status': aggregator.GAUGE,
'cert_manager.certificate_expiration_timestamp': aggregator.GAUGE,
'cert_manager.acme_client_request_count': aggregator.MONOTONIC_COUNT,
'cert_manager.acme_client_request_duration.sum': aggregator.GAUGE,
'cert_manager.acme_client_request_duration.count': aggregator.GAUGE,
'cert_manager.acme_client_request_duration.quantile': aggregator.GAUGE,
'cert_manager.controller_sync_call_count': aggregator.MONOTONIC_COUNT,
'cert_manager.certificate.ready_status': aggregator.GAUGE,
'cert_manager.certificate.expiration_timestamp': aggregator.GAUGE,
'cert_manager.acme_client.request.count': aggregator.MONOTONIC_COUNT,
'cert_manager.acme_client.request.duration.sum': aggregator.GAUGE,
'cert_manager.acme_client.request.duration.count': aggregator.GAUGE,
'cert_manager.acme_client.request.duration.quantile': aggregator.GAUGE,
'cert_manager.controller.sync_call.count': aggregator.MONOTONIC_COUNT,
'cert_manager.prometheus.health': aggregator.GAUGE,
}

Expand Down

0 comments on commit 87ce2c4

Please sign in to comment.