Application metrics¶
Applications can use Sasquatch infrastructure to publish metrics events to InfluxDB via Kafka.
Setting certain Sasquatch values in Phalanx will create Kafka user and topic, and configure a Telegraf consumer to put messages from that topic into the lsst.square.metrics
database in the Sasquatch InfluxDB instance.
The messages are expected to be in Avro format, and schemas are expected to be in the Schema Registry for any messages that are encoded with a schema ID.
Configuration¶
Apps that want to publish metrics events need to:
Set
app-metrics.enabled
totrue
in every Sasquatch environment values files where app metrics should be enabledAdd the app name to the
app-metrics.apps
list in the Sasquatch environment values fileAdd an entry to the
globalAppConfig
dict in the app-metricsvalues.yaml
file in Phalanx.
This entry should be structured like this:
globalAppConfig:
# App name
some-app: # App name
# An array of events keys that will be tags (vs. fields) in InfluxDB
influxTags: [ "foo", "bar" ]
some-other-app:
influxTags: [ "foo", "bar", "baz" ]
This will:
Provision a Kafka topic to which the app can publish events
Provision a Kafka user with access to publish messages to that topic
Update the
sasquatch-telegraf-app-metrics
Telegraf instance to:
Then in your app, you can connect to kafka and publish events manually, or if you have a Safir app, you can use the Safir metrics helpers to streamline this integration.