Skip to content

Commit

Permalink
Reflect new metric types in haproxy metadata (DataDog#8489)
Browse files Browse the repository at this point in the history
* Changed metadata to reflect new metric types, commented out related test

* Update haproxy/tests/legacy/test_haproxy.py

Co-authored-by: Paul <[email protected]>

* uncomment import

Co-authored-by: Luis Gonzalez <[email protected]>
Co-authored-by: Paul <[email protected]>
Co-authored-by: Luis Gonzalez <[email protected]>
  • Loading branch information
4 people authored Mar 15, 2021
1 parent 2dde354 commit ef5aaea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions haproxy/metadata.csv
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
metric_name,metric_type,interval,unit_name,per_unit_name,description,orientation,integration,short_name
haproxy.backend.active.servers,gauge,,,,Current number of active servers.,0,haproxy,
haproxy.backend.backup.servers,gauge,,,,Current number of backup servers.,0,haproxy,
haproxy.backend.bytes.in.total,gauge,,byte,,Current total of incoming bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.backend.bytes.out.total,gauge,,byte,,Current total of outgoing bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.backend.bytes.in.total,count,,byte,,Current total of incoming bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.backend.bytes.out.total,count,,byte,,Current total of outgoing bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.backend.check.last.change.seconds,gauge,,,,Number of seconds since the last UP<->DOWN transition.,0,haproxy,
haproxy.backend.check.up.down.total,count,,,,Total number of UP->DOWN transitions.,0,haproxy,
haproxy.backend.client.aborts.total,count,,,,Total number of data transfers aborted by the client.,0,haproxy,
Expand Down Expand Up @@ -73,8 +73,8 @@ haproxy.backend.uptime,gauge,,second,,Number of seconds since the last UP<->DOWN
haproxy.backend.warnings.redis_rate,gauge,,error,second,Number of times a request was redispatched to another server (legacy check only).,-1,haproxy,backend warn redis rate
haproxy.backend.warnings.retr_rate,gauge,,error,second,Number of times a connection to a server was retried (legacy check only).,-1,haproxy,backend warn retry rate
haproxy.count_per_status,gauge,,host,,Number of hosts by status (UP/DOWN/NOLB/MAINT) (legacy check only).,0,haproxy,hosts status
haproxy.frontend.bytes.in.total,gauge,,byte,,Current total of incoming bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.frontend.bytes.out.total,gauge,,byte,,Current total of outgoing bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.frontend.bytes.in.total,count,,byte,,Current total of incoming bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.frontend.bytes.out.total,count,,byte,,Current total of outgoing bytes. By default submitted as count if using prometheus,0,haproxy,
haproxy.frontend.connections.rate.max,gauge,,,,Maximum observed number of connections per second.,0,haproxy,
haproxy.frontend.connections.total,count,,,,Total number of connections.,0,haproxy,
haproxy.frontend.current.sessions,gauge,,,,Current number of active sessions.,0,haproxy,
Expand Down
12 changes: 11 additions & 1 deletion haproxy/tests/legacy/test_haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,17 @@ def test_check(aggregator, check, instance):
_test_service_checks(aggregator, count=0)

aggregator.assert_all_metrics_covered()
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), check_submission_type=True)
# The assertion below fails due to difference between new and legacy metric types in metadata.
aggregator.assert_metrics_using_metadata(
get_metadata_metrics(),
check_submission_type=True,
exclude=[
'haproxy.frontend.bytes.in.total',
'haproxy.frontend.bytes.out.total',
'haproxy.backend.bytes.in.total',
'haproxy.backend.bytes.out.total',
],
)


@requires_socket_support
Expand Down

0 comments on commit ef5aaea

Please sign in to comment.