Observability
Export Chalk logs to other monitoring systems.
Chalk’s online dashboard provides a simple way to view logs from resolver execution. However, you may wish to export these logs into other observability tools so that you can view your Chalk-related data alongside data from other systems you maintain.
Chalk can export your logs to a sink of your choosing. You can configure sinks for log export from your settings page. Exported logs will contain the following fields:
@timestampInstantISO8601 timestamp.
@versionstringThe log line format version. Currently constant “1”.
messagestringThe log message.
logger_namestringName of the logger, if relevant.
levelstringThe log level as a string: “INFO”, “WARN”, “ERROR”, “DEBUG”.
stack_tracestringStack trace of the associated exception, if relevant.
tracestringA trace ID in OpenCensus format. Used for correlating logs corresponding to a single query.
projectstringChalk Project ID.
deploymentstringChalk Deployment ID. Can be used to understand log patterns as code evolves.
commit_shastringYour commit SHA, if available for the deployment.
contextstring“online” or “offline”.
resolver_namestringThe name of the resolver that produced this log line, if available.
environmentstringEnvironment name.
environment_idstringEnvironment ID.
tagsstring[]An array of the tags that were provided for the associated query.
agent_idstringThe ID of the agent that made the request (a service token or Chalk user).
Chalk provides an implementation of the standard Python Logger interface that supports emitting logs to the web UI and your metrics export sink. You can use this logger like this:
from chalk.clogging import chalk_logger
@online
def your_resolver(...):
chalk_logger.info("Hello world!")