boulder/test
Jacob Hoffman-Andrews 58ccd7a71a Copy all statsd stats to Prometheus. (#2474)
We have a number of stats already expressed using the statsd interface. During
the switchover period to direct Prometheus collection, we'd like to make those
stats available both ways. This change automatically exports any stats exported
using the statsd interface via Prometheus as well.

This is a little tricky because Prometheus expects all stats to by registered
exactly once. Prometheus does offer a mechanism to gracefully recover from
registering a stat more than once by handling a certain error, but it is not
safe for concurrent access. So I added a concurrency-safe wrapper that creates
Prometheus stats on demand and memoizes them.

In the process, made a few small required side changes:
 - Clean "/" from method names in the gRPC interceptors. They are allowed in
   statsd but not in Prometheus.
 - Replace "127.0.0.1" with "boulder" as the name of our testing CT log.
   Prometheus stats can't start with a number.
 - Remove ":" from the CT-log stat names emitted by Publisher. Prometheus stats
   can't include it.
 - Remove a stray "RA" in front of some rate limit stats, since it was
   duplicative (we were emitting "RA.RA..." before).

Note that this means two stat groups in particular are duplicated:
 - Gostats* is duplicated with the default process-level stats exported by the
   Prometheus library.
 - gRPCClient* are duplicated by the stats generated by the go-grpc-prometheus
   package.

When writing dashboards and alerts in the Prometheus world, we should be careful
to avoid these two categories, as they will disappear eventually. As a general
rule, if a stat is available with an all-lowercase name, choose that one, as it
is probably the Prometheus-native version.

In the long run we will want to create most stats using the native Prometheus
stat interface, since it allows us to use add labels to metrics, which is very
useful. For instance, currently our DNS stats distinguish types of queries by
appending the type to the stat name. This would be more natural as a label in
Prometheus.
2017-01-10 10:30:15 -05:00
..
boulder-tools Switch to Golang 1.7.3 in travis (#2305) 2016-11-07 10:49:23 -08:00
config Copy all statsd stats to Prometheus. (#2474) 2017-01-10 10:30:15 -05:00
config-next Copy all statsd stats to Prometheus. (#2474) 2017-01-10 10:30:15 -05:00
ct-test-srv Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
dns-test-srv Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
grpc-creds Split out separate RPC services for issuing and for signing OCSP (#2452) 2017-01-05 15:08:39 -08:00
js Add admin-revoker integration tests for serial-revoke and auth-revoke (#2421) 2016-12-15 16:54:32 -08:00
mail-test-srv Fixes gofmt -s diffs 2016-11-30 13:30:03 -05:00
secrets Adds `notafter-backfiller` cmd. (#2227) 2016-10-11 14:38:40 -07:00
vars Fix max_statement_time and long_query_time (#2311) 2016-11-08 09:07:36 -05:00
caa-servfail-exceptions.txt Add enforcement for CAA SERVFAIL (#1971) 2016-06-28 11:00:23 -07:00
cfssl-config.json Move cert-csr check to boulder/core and review fixes 2015-06-02 17:56:28 +01:00
create_db.sh Local DB migration improvements (`-next` directory, auto-migrate) (#2206) 2016-09-26 21:37:05 -07:00
ct-key.pem Use a EC key to sign CT signatures, plus properly load it 2015-12-15 13:50:43 -08:00
db-common.sh * Delete Policy DB.This is no longer needed now that we have a JSON policy file.* Fix tests.* Revert Dockerfile.* Fix create_db* Simplify user addition.* Fix tests.* Fix tests* Review fixes.https://github.com/letsencrypt/boulder/pull/1773 2016-04-29 12:12:24 -07:00
db.go * Delete Policy DB.This is no longer needed now that we have a JSON policy file.* Fix tests.* Revert Dockerfile.* Fix create_db* Simplify user addition.* Fix tests.* Fix tests* Review fixes.https://github.com/letsencrypt/boulder/pull/1773 2016-04-29 12:12:24 -07:00
docker-environment Switch to Golang 1.6.3 (#2105) 2016-08-05 16:35:43 -04:00
drop_users.sql Add cmd/expired-authz-purger (#1828) 2016-06-03 16:00:19 -04:00
entrypoint.sh Split up gRPC certificates by service. (#2453) 2016-12-29 14:53:59 -08:00
example-expiration-template Review fixes 2015-07-27 12:46:09 -07:00
hostname-policy.json Add explicit forbidden names validation to cert-checker (#2373) 2016-12-02 11:55:24 -08:00
integration-test.py Fix typo 2016-12-15 12:47:36 -08:00
issuer-ocsp-responder.json Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
make-softhsm.sh Fix non-Docker integration test. (#2184) 2016-09-16 18:21:33 -07:00
migrate-up.sh Add a test that there are no outdated migrations. 2015-09-18 14:53:40 -07:00
rate-limit-policies-b.yml Add certificatesPerName rate limit to integration test (#1940) 2016-06-17 16:10:05 -07:00
rate-limit-policies.yml Add certificatesPerName rate limit to integration test (#1940) 2016-06-17 16:10:05 -07:00
run-docker.sh Roll forward "Run Travis tests in Docker (#1830)" (#1838) 2016-05-24 15:11:22 -07:00
sa_db_users.sql Reverts pending auth/authz table merge. (#2297) 2016-10-31 10:31:19 -07:00
setup.sh Very basic feature flag impl (#1705) 2016-09-20 16:29:01 -07:00
startservers.py Revert "Disable fail-fast for gRPC. (#2397)" (#2427) 2016-12-13 13:20:08 -08:00
test-ca.der Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-ca.key Make it easier to start a test config. 2015-04-09 18:26:40 -07:00
test-ca.key-pkcs11.json Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
test-ca.key.der Add DER form of test-ca key in-tree. (#2041) 2016-07-12 09:06:59 -07:00
test-ca.pem Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-ca2.pem Add multi-issuer support to the CA. 2016-03-21 20:56:58 -07:00
test-no-outdated-migrations.sh Fix mktemp to be MacOS compatible 2015-09-23 13:16:16 -07:00
test-root.key Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-root.key-pkcs11.json Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
test-root.key.der Improve single-ocsp command (#2181) 2016-09-15 15:28:54 -07:00
test-root.pem Unflake OCSP integration test 2015-10-21 14:38:15 -07:00
test-tools.go Change `%v` to `%#v` in AssertEquals error msg. (#1983) 2016-06-28 08:42:51 -07:00
travis-before-install.sh Run travis-before-install once more. (#1858) 2016-05-31 14:06:02 -07:00