DataDog Plugin
The DataDog Log plugin enables pushing logs to DataDog.
Enterprise Feature
Custom logging is available as an add-on as part of an enterprise plan. If you would like to purchase this feature, please contact us at sales@zuplo.com or reach out to your account manager.
Most enterprise features can be used in a trial mode for a limited time. Feel free to use enterprise features for development and testing purposes.
Setup
To add the DataDog logging plugin to your Zuplo project, add the following code
to your zuplo.runtime.ts
file.
modules/zuplo.runtime.tsts
Configuration Options
The DataDogLoggingPlugin
constructor accepts an options object with the
following properties:
apiKey
- (required) Your DataDog API key for authenticationurl
- (optional) The DataDog logs intake URL. Defaults to the DataDog logs API endpointsource
- (optional) The source of the logs, typically the name of the application or service. Defaults to "Zuplo"fields
- (optional) Custom fields to include in each log entry. Can contain string, number, or boolean valuestags
- (optional) Custom tags to include in each log entry as key-value pairs
Custom Fields
Any custom fields you want to include in the log entry can be added to the
fields
property. These values will be appended to every log entry.
Tags
Any custom tags you want to include in the log entry can be added to the tags
property. These values will be appended to every log entry.
Default Fields
Every log entry will include the following fields (in snake_case format for DataDog):
timestamp
- The time the log was created (ISO 8601 format)severity
- The log level (e.g.,ERROR
,INFO
,DEBUG
,WARN
)message
- The complete log message and datamsg
- The first string message extracted from the log entryenvironment_type
- Where the Zuplo API is running. Values areedge
,working-copy
, orlocal
environment_stage
- The deployment stage:working-copy
,preview
, orproduction
request_id
- The UUID of the request (the value of thezp-rid
header)atomic_counter
- An atomic counter used to order logs with identical timestampsray_id
- The network provider identifier (e.g., Cloudflare Ray ID) of the request