teff.observability.builder¶
teff.observability.builder
¶
Build a :class:GraphObserver from a workflow's observability: block.
The block is declarative data inside a workflow.yaml::
observability:
db: ./data/traces.db # our SQLite dashboard (relative to the workflow)
export: # optional fan-out to remote sinks
- type: langfuse
public_key_env: LANGFUSE_PUBLIC_KEY
secret_key_env: LANGFUSE_SECRET_KEY
host: https://cloud.langfuse.com
- type: langsmith
api_key_env: LANGCHAIN_API_KEY
project: my-project
- type: webhook
url: https://hooks.example.com/traces
Relative paths resolve against the workflow file's directory and secrets come from environment variables, never from the file itself.
Functions:
| Name | Description |
|---|---|
build_observability |
Assemble a :class: |
build_observer_factory |
Like :func: |
build_remote_exporter |
Construct a remote exporter from one |
build_observability
¶
build_observability(config, *, base_dir='.', graph=None, name='workflow')
Assemble a :class:GraphObserver from an observability: block.
Returns None when the block is missing or declares no sinks. The
observer is wired with the graph topology so remote exporters and the
dashboard can render the flow.
Source code in teff/observability/builder.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
build_observer_factory
¶
build_observer_factory(config, *, base_dir='.', graph=None, name='workflow')
Like :func:build_observability but for repeated runs.
Returns a zero-arg callable that yields a fresh observer per run while
sharing one set of exporters — the right shape for a daemon that traces
every tick. None when observability is not configured.
Source code in teff/observability/builder.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
build_remote_exporter
¶
build_remote_exporter(spec, *, base_dir='.')
Construct a remote exporter from one observability.export entry.
Source code in teff/observability/builder.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |