View Source Pacer.Config (Pacer v0.1.6)

The Pacer.Config module provides functions for extracting user-provided configuration values specific to Pacer.

Summary

Functions

Fetches configuration options for extending the metadata provided in the [:pacer, :execute_vertex, :start | :stop | :exception] events for batched resolvers.

Takes the batch_telemetry_options configuration, invoking mfa-style config if available, and converts the batch_telemetry_options keyword list into a map that gets merged into the metadata for the [:pacer, :execute_vertex, :start | :stop | :exception] events for batched resolvers.

Functions

Link to this function

batch_telemetry_options(workflow_module)

View Source
@spec batch_telemetry_options(module()) :: keyword() | {module(), atom(), list()}

Fetches configuration options for extending the metadata provided in the [:pacer, :execute_vertex, :start | :stop | :exception] events for batched resolvers.

The configuration must be set under the key :batch_telemetry_options at the application level (i.e., Application.get_env(:pacer, :batch_telemetry_options)) or when defining the workflow itself (use Pacer.Workflow, batch_telemetry_options: <opts>).

The batch_telemetry_options defined by the user must be either:

  • a keyword list, or
  • a {module, function, args} mfa tuple; when invoked, this function must return a keyword list

The keyword list of values returned by the mfa-style config, or the hardcoded keyword list, is fetched and converted into a map that gets merged into the telemetry event metadata for batched resolvers.

Link to this function

fetch_batch_telemetry_options(workflow_module)

View Source
@spec fetch_batch_telemetry_options(module()) :: map()

Takes the batch_telemetry_options configuration, invoking mfa-style config if available, and converts the batch_telemetry_options keyword list into a map that gets merged into the metadata for the [:pacer, :execute_vertex, :start | :stop | :exception] events for batched resolvers.