feat: Adds telemetry for faucet and postgresql #149
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This feature will allow us track the number of requests, response times and other data for plumber APIs and Shiny Applications.
The new feature
HTTP Telemetry
faucet now offers the option of saving HTTP events to a PostgreSQL database.
This can be very helpful for tracking latency, total API calls and other
important information.
In order to use this feature you will need a PostgreSQL database with a table
called
faucet_http_events
. You can create the table using this table withthe following SQL query:
Connection Strings
In order to connect to the database you will need to pass the
FAUCET_TELEMETRY_POSTGRES_STRING
environment variable or the--pg-con-string
CLI argument.This should include either a connection string or a URL with the
postgres://
protocol.
Example connection strings
Telemetry Namespaces
It is likely you want to track different services on the same database. You
can control the column
namespace
using the environment variableFAUCET_TELEMETRY_NAMESPACE
or cli argument--telemetry-namespace
. Bydefault, this value is
"faucet"