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

Add metrics for the checksums of the HTTP body #1354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

silkeh
Copy link
Contributor

@silkeh silkeh commented Jan 11, 2025

Add metrics to monitor the integrity of an HTTP resource. These are configured using:

  • fail_if_body_not_matches_hash configures hash-based probe failures.
  • hash_algorithm (sha256 by default) configures the hash used.
  • export_hash enables exporting the hashed body as a label.

This results in the following new metrics:

  • probe_http_content_checksum contains the CRC32 of the page as a value. This is not cryptographically secure, but should work sufficiently well for monitoring changes in normal situations.
  • probe_http_content_hash contains a configurable hash of the page in a label. This is cryptographically secure, but may lead to high cardinality when enabled. The hash is configurable.
  • probe_failed_due_to_hash contains a metric that indicates if the probe failed because the content hash did not match the expected value.

Resolves #351

@silkeh silkeh changed the title Add a metrics for the checksums of the HTTP body Add metrics for the checksums of the HTTP body Jan 11, 2025
Add metrics to monitor the integrity of an HTTP resource.
These are configured using:

- `fail_if_body_not_matches_hash` configures hash-based probe failures.
- `hash_algorithm` (`sha256` by default) configures the hash used.
- `export_hash` enables exporting the hashed body as a label.

This results in the following new metrics:

- `probe_http_content_checksum` contains the CRC32 of the page as a value.
  This is not cryptographically secure, but should work sufficiently well
  for monitoring changes in normal situations.
- `probe_http_content_hash` contains a configurable hash of the page in a label.
  This *is* cryptographically secure, but may lead to high cardinality when enabled.
  The hash is configurable.
- `probe_failed_due_to_hash` contains a metric that indicates if the probe failed
  because the content hash did not match the expected value.

Signed-off-by: Silke Hofstra <[email protected]>
@silkeh silkeh force-pushed the pr/http-content-checksum branch from e041036 to 4821d61 Compare January 11, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request : md5 on a page
1 participant