Skip to content

feat: add neutral telemetry contracts#775

Merged
intel352 merged 4 commits into
mainfrom
feat/observability-core-contracts
May 25, 2026
Merged

feat: add neutral telemetry contracts#775
intel352 merged 4 commits into
mainfrom
feat/observability-core-contracts

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

  • Add neutral Workflow telemetry contracts for metric emitters, log emitters, trace annotators, and snapshot recording.
  • Add SDK aliases so external plugins can satisfy telemetry interfaces without importing the observability plugin.
  • Add a host-side telemetry bridge that discovers emitters in-process and forwards to an observability sink through service invocation, defaulting to no-op when absent.

Release dependency

This PR must merge first. After green merge, tag the next Workflow release and update downstream CMS to depend on that released Workflow version instead of the feature-branch pseudo-version.

Test Plan

  • GOWORK=off go test ./telemetry ./plugins/observability ./plugin/external/sdk

Related Plan

  • workflow-plugin-observability docs/plans/2026-05-25-observability-plugin.md, PR row 1 / Tasks 1-2

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:276: parsing iteration count: invalid syntax
baseline-bench.txt:344578: parsing iteration count: invalid syntax
baseline-bench.txt:628514: parsing iteration count: invalid syntax
baseline-bench.txt:954633: parsing iteration count: invalid syntax
baseline-bench.txt:1313449: parsing iteration count: invalid syntax
baseline-bench.txt:1618871: parsing iteration count: invalid syntax
benchmark-results.txt:276: parsing iteration count: invalid syntax
benchmark-results.txt:307735: parsing iteration count: invalid syntax
benchmark-results.txt:625133: parsing iteration count: invalid syntax
benchmark-results.txt:895737: parsing iteration count: invalid syntax
benchmark-results.txt:1217605: parsing iteration count: invalid syntax
benchmark-results.txt:1541120: parsing iteration count: invalid syntax
goos: linux
goarch: amd64
pkg: github.com/GoCodeAlone/workflow/dynamic
cpu: AMD EPYC 7763 64-Core Processor                
                            │ benchmark-results.txt │
                            │        sec/op         │
InterpreterCreation-4                  8.997m ± 65%
ComponentLoad-4                        3.701m ± 14%
ComponentExecute-4                     1.959µ ±  1%
PoolContention/workers-1-4             1.137µ ±  2%
PoolContention/workers-2-4             1.120µ ±  2%
PoolContention/workers-4-4             1.117µ ±  2%
PoolContention/workers-8-4             1.135µ ±  1%
PoolContention/workers-16-4            1.125µ ±  3%
ComponentLifecycle-4                   3.779m ±  4%
SourceValidation-4                     2.457µ ±  0%
RegistryConcurrent-4                   896.3n ±  2%
LoaderLoadFromString-4                 3.794m ±  2%
geomean                                19.85µ

                            │ benchmark-results.txt │
                            │         B/op          │
InterpreterCreation-4                  2.027Mi ± 0%
ComponentLoad-4                        2.180Mi ± 0%
ComponentExecute-4                     1.203Ki ± 0%
PoolContention/workers-1-4             1.203Ki ± 0%
PoolContention/workers-2-4             1.203Ki ± 0%
PoolContention/workers-4-4             1.203Ki ± 0%
PoolContention/workers-8-4             1.203Ki ± 0%
PoolContention/workers-16-4            1.203Ki ± 0%
ComponentLifecycle-4                   2.183Mi ± 0%
SourceValidation-4                     1.984Ki ± 0%
RegistryConcurrent-4                   1.133Ki ± 0%
LoaderLoadFromString-4                 2.182Mi ± 0%
geomean                                15.25Ki

                            │ benchmark-results.txt │
                            │       allocs/op       │
InterpreterCreation-4                   15.68k ± 0%
ComponentLoad-4                         18.02k ± 0%
ComponentExecute-4                       25.00 ± 0%
PoolContention/workers-1-4               25.00 ± 0%
PoolContention/workers-2-4               25.00 ± 0%
PoolContention/workers-4-4               25.00 ± 0%
PoolContention/workers-8-4               25.00 ± 0%
PoolContention/workers-16-4              25.00 ± 0%
ComponentLifecycle-4                    18.07k ± 0%
SourceValidation-4                       32.00 ± 0%
RegistryConcurrent-4                     2.000 ± 0%
LoaderLoadFromString-4                  18.06k ± 0%
geomean                                  183.3

cpu: AMD EPYC 9V74 80-Core Processor                
                            │ baseline-bench.txt │
                            │       sec/op       │
InterpreterCreation-4              4.445m ± 129%
ComponentLoad-4                    3.471m ±   8%
ComponentExecute-4                 1.815µ ±   1%
PoolContention/workers-1-4         1.012µ ±   1%
PoolContention/workers-2-4         1.007µ ±   0%
PoolContention/workers-4-4         1.000µ ±   1%
PoolContention/workers-8-4         1.007µ ±   2%
PoolContention/workers-16-4        1.010µ ±   0%
ComponentLifecycle-4               3.480m ±   3%
SourceValidation-4                 2.087µ ±   2%
RegistryConcurrent-4               734.8n ±   5%
LoaderLoadFromString-4             3.506m ±   1%
geomean                            16.90µ

                            │ baseline-bench.txt │
                            │        B/op        │
InterpreterCreation-4               2.027Mi ± 0%
ComponentLoad-4                     2.180Mi ± 0%
ComponentExecute-4                  1.203Ki ± 0%
PoolContention/workers-1-4          1.203Ki ± 0%
PoolContention/workers-2-4          1.203Ki ± 0%
PoolContention/workers-4-4          1.203Ki ± 0%
PoolContention/workers-8-4          1.203Ki ± 0%
PoolContention/workers-16-4         1.203Ki ± 0%
ComponentLifecycle-4                2.183Mi ± 0%
SourceValidation-4                  1.984Ki ± 0%
RegistryConcurrent-4                1.133Ki ± 0%
LoaderLoadFromString-4              2.182Mi ± 0%
geomean                             15.25Ki

                            │ baseline-bench.txt │
                            │     allocs/op      │
InterpreterCreation-4                15.68k ± 0%
ComponentLoad-4                      18.02k ± 0%
ComponentExecute-4                    25.00 ± 0%
PoolContention/workers-1-4            25.00 ± 0%
PoolContention/workers-2-4            25.00 ± 0%
PoolContention/workers-4-4            25.00 ± 0%
PoolContention/workers-8-4            25.00 ± 0%
PoolContention/workers-16-4           25.00 ± 0%
ComponentLifecycle-4                 18.07k ± 0%
SourceValidation-4                    32.00 ± 0%
RegistryConcurrent-4                  2.000 ± 0%
LoaderLoadFromString-4               18.06k ± 0%
geomean                               183.3

pkg: github.com/GoCodeAlone/workflow/middleware
cpu: AMD EPYC 7763 64-Core Processor                
                                  │ benchmark-results.txt │
                                  │        sec/op         │
CircuitBreakerDetection-4                     287.8n ± 5%
CircuitBreakerExecution_Success-4             21.32n ± 2%
CircuitBreakerExecution_Failure-4             66.37n ± 0%
geomean                                       74.12n

                                  │ benchmark-results.txt │
                                  │         B/op          │
CircuitBreakerDetection-4                    144.0 ± 0%
CircuitBreakerExecution_Success-4            0.000 ± 0%
CircuitBreakerExecution_Failure-4            0.000 ± 0%
geomean                                                 ¹
¹ summaries must be >0 to compute geomean

                                  │ benchmark-results.txt │
                                  │       allocs/op       │
CircuitBreakerDetection-4                    1.000 ± 0%
CircuitBreakerExecution_Success-4            0.000 ± 0%
CircuitBreakerExecution_Failure-4            0.000 ± 0%
geomean                                                 ¹
¹ summaries must be >0 to compute geomean

cpu: AMD EPYC 9V74 80-Core Processor                
                                  │ baseline-bench.txt │
                                  │       sec/op       │
CircuitBreakerDetection-4                 299.8n ± 18%
CircuitBreakerExecution_Success-4         22.65n ±  1%
CircuitBreakerExecution_Failure-4         70.91n ±  0%
geomean                                   78.38n

                                  │ baseline-bench.txt │
                                  │        B/op        │
CircuitBreakerDetection-4                 144.0 ± 0%
CircuitBreakerExecution_Success-4         0.000 ± 0%
CircuitBreakerExecution_Failure-4         0.000 ± 0%
geomean                                              ¹
¹ summaries must be >0 to compute geomean

                                  │ baseline-bench.txt │
                                  │     allocs/op      │
CircuitBreakerDetection-4                 1.000 ± 0%
CircuitBreakerExecution_Success-4         0.000 ± 0%
CircuitBreakerExecution_Failure-4         0.000 ± 0%
geomean                                              ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/module
cpu: AMD EPYC 7763 64-Core Processor                
                                 │ benchmark-results.txt │
                                 │        sec/op         │
IaCStateBackend_InProcess-4                 320.8n ± 28%
IaCStateBackend_GRPC-4                      9.671m ±  3%
JQTransform_Simple-4                        690.2n ± 33%
JQTransform_ObjectConstruction-4            1.506µ ±  1%
JQTransform_ArraySelect-4                   3.510µ ±  1%
JQTransform_Complex-4                       39.65µ ±  0%
JQTransform_Throughput-4                    1.850µ ±  1%
SSEPublishDelivery-4                        64.39n ±  1%
geomean                                     3.899µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
IaCStateBackend_InProcess-4                 416.0 ± 0%
IaCStateBackend_GRPC-4                    5.859Mi ± 8%
JQTransform_Simple-4                      1.273Ki ± 0%
JQTransform_ObjectConstruction-4          1.773Ki ± 0%
JQTransform_ArraySelect-4                 2.625Ki ± 0%
JQTransform_Complex-4                     16.22Ki ± 0%
JQTransform_Throughput-4                  1.984Ki ± 0%
SSEPublishDelivery-4                        0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

                                 │ benchmark-results.txt │
                                 │       allocs/op       │
IaCStateBackend_InProcess-4                 2.000 ± 0%
IaCStateBackend_GRPC-4                     6.838k ± 0%
JQTransform_Simple-4                        10.00 ± 0%
JQTransform_ObjectConstruction-4            15.00 ± 0%
JQTransform_ArraySelect-4                   30.00 ± 0%
JQTransform_Complex-4                       324.0 ± 0%
JQTransform_Throughput-4                    17.00 ± 0%
SSEPublishDelivery-4                        0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

cpu: AMD EPYC 9V74 80-Core Processor                
                                 │ baseline-bench.txt │
                                 │       sec/op       │
IaCStateBackend_InProcess-4              297.7n ± 23%
IaCStateBackend_GRPC-4                   10.13m ±  1%
JQTransform_Simple-4                     635.0n ± 34%
JQTransform_ObjectConstruction-4         1.416µ ±  0%
JQTransform_ArraySelect-4                3.447µ ±  1%
JQTransform_Complex-4                    41.59µ ±  0%
JQTransform_Throughput-4                 1.762µ ±  1%
SSEPublishDelivery-4                     63.76n ±  1%
geomean                                  3.802µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
IaCStateBackend_InProcess-4             416.0 ±  0%
IaCStateBackend_GRPC-4                5.916Mi ± 14%
JQTransform_Simple-4                  1.273Ki ±  0%
JQTransform_ObjectConstruction-4      1.773Ki ±  0%
JQTransform_ArraySelect-4             2.625Ki ±  0%
JQTransform_Complex-4                 16.22Ki ±  0%
JQTransform_Throughput-4              1.984Ki ±  0%
SSEPublishDelivery-4                    0.000 ±  0%
geomean                                             ¹
¹ summaries must be >0 to compute geomean

                                 │ baseline-bench.txt │
                                 │     allocs/op      │
IaCStateBackend_InProcess-4              2.000 ± 0%
IaCStateBackend_GRPC-4                  6.859k ± 0%
JQTransform_Simple-4                     10.00 ± 0%
JQTransform_ObjectConstruction-4         15.00 ± 0%
JQTransform_ArraySelect-4                30.00 ± 0%
JQTransform_Complex-4                    324.0 ± 0%
JQTransform_Throughput-4                 17.00 ± 0%
SSEPublishDelivery-4                     0.000 ± 0%
geomean                                             ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/schema
cpu: AMD EPYC 7763 64-Core Processor                
                                    │ benchmark-results.txt │
                                    │        sec/op         │
SchemaValidation_Simple-4                      1.092µ ±  4%
SchemaValidation_AllFields-4                   1.652µ ± 17%
SchemaValidation_FormatValidation-4            1.588µ ±  1%
SchemaValidation_ManySchemas-4                 1.794µ ±  4%
geomean                                        1.505µ

                                    │ benchmark-results.txt │
                                    │         B/op          │
SchemaValidation_Simple-4                      0.000 ± 0%
SchemaValidation_AllFields-4                   0.000 ± 0%
SchemaValidation_FormatValidation-4            0.000 ± 0%
SchemaValidation_ManySchemas-4                 0.000 ± 0%
geomean                                                   ¹
¹ summaries must be >0 to compute geomean

                                    │ benchmark-results.txt │
                                    │       allocs/op       │
SchemaValidation_Simple-4                      0.000 ± 0%
SchemaValidation_AllFields-4                   0.000 ± 0%
SchemaValidation_FormatValidation-4            0.000 ± 0%
SchemaValidation_ManySchemas-4                 0.000 ± 0%
geomean                                                   ¹
¹ summaries must be >0 to compute geomean

cpu: AMD EPYC 9V74 80-Core Processor                
                                    │ baseline-bench.txt │
                                    │       sec/op       │
SchemaValidation_Simple-4                   1.073µ ±  5%
SchemaValidation_AllFields-4                1.614µ ± 13%
SchemaValidation_FormatValidation-4         1.601µ ±  2%
SchemaValidation_ManySchemas-4              1.584µ ±  2%
geomean                                     1.447µ

                                    │ baseline-bench.txt │
                                    │        B/op        │
SchemaValidation_Simple-4                   0.000 ± 0%
SchemaValidation_AllFields-4                0.000 ± 0%
SchemaValidation_FormatValidation-4         0.000 ± 0%
SchemaValidation_ManySchemas-4              0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

                                    │ baseline-bench.txt │
                                    │     allocs/op      │
SchemaValidation_Simple-4                   0.000 ± 0%
SchemaValidation_AllFields-4                0.000 ± 0%
SchemaValidation_FormatValidation-4         0.000 ± 0%
SchemaValidation_ManySchemas-4              0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/store
cpu: AMD EPYC 7763 64-Core Processor                
                                   │ benchmark-results.txt │
                                   │        sec/op         │
EventStoreAppend_InMemory-4                   1.310µ ± 18%
EventStoreAppend_SQLite-4                     1.598m ±  7%
GetTimeline_InMemory/events-10-4              13.45µ ±  2%
GetTimeline_InMemory/events-50-4              75.95µ ±  2%
GetTimeline_InMemory/events-100-4             139.2µ ± 13%
GetTimeline_InMemory/events-500-4             639.4µ ±  3%
GetTimeline_InMemory/events-1000-4            1.309m ±  1%
GetTimeline_SQLite/events-10-4                109.9µ ±  2%
GetTimeline_SQLite/events-50-4                261.4µ ±  2%
GetTimeline_SQLite/events-100-4               442.1µ ±  3%
GetTimeline_SQLite/events-500-4               1.822m ±  5%
GetTimeline_SQLite/events-1000-4              3.514m ±  2%
geomean                                       228.5µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                     783.5 ± 9%
EventStoreAppend_SQLite-4                     1.985Ki ± 1%
GetTimeline_InMemory/events-10-4              7.953Ki ± 0%
GetTimeline_InMemory/events-50-4              46.62Ki ± 0%
GetTimeline_InMemory/events-100-4             94.48Ki ± 0%
GetTimeline_InMemory/events-500-4             472.8Ki ± 0%
GetTimeline_InMemory/events-1000-4            944.3Ki ± 0%
GetTimeline_SQLite/events-10-4                16.74Ki ± 0%
GetTimeline_SQLite/events-50-4                87.14Ki ± 0%
GetTimeline_SQLite/events-100-4               175.4Ki ± 0%
GetTimeline_SQLite/events-500-4               846.1Ki ± 0%
GetTimeline_SQLite/events-1000-4              1.639Mi ± 0%
geomean                                       67.30Ki

                                   │ benchmark-results.txt │
                                   │       allocs/op       │
EventStoreAppend_InMemory-4                     7.000 ± 0%
EventStoreAppend_SQLite-4                       53.00 ± 0%
GetTimeline_InMemory/events-10-4                125.0 ± 0%
GetTimeline_InMemory/events-50-4                653.0 ± 0%
GetTimeline_InMemory/events-100-4              1.306k ± 0%
GetTimeline_InMemory/events-500-4              6.514k ± 0%
GetTimeline_InMemory/events-1000-4             13.02k ± 0%
GetTimeline_SQLite/events-10-4                  382.0 ± 0%
GetTimeline_SQLite/events-50-4                 1.852k ± 0%
GetTimeline_SQLite/events-100-4                3.681k ± 0%
GetTimeline_SQLite/events-500-4                18.54k ± 0%
GetTimeline_SQLite/events-1000-4               37.29k ± 0%
geomean                                        1.162k

cpu: AMD EPYC 9V74 80-Core Processor                
                                   │ baseline-bench.txt │
                                   │       sec/op       │
EventStoreAppend_InMemory-4                1.103µ ± 13%
EventStoreAppend_SQLite-4                  1.089m ±  4%
GetTimeline_InMemory/events-10-4           12.33µ ±  3%
GetTimeline_InMemory/events-50-4           68.46µ ±  3%
GetTimeline_InMemory/events-100-4          121.7µ ± 13%
GetTimeline_InMemory/events-500-4          559.4µ ±  1%
GetTimeline_InMemory/events-1000-4         1.135m ±  3%
GetTimeline_SQLite/events-10-4             84.73µ ±  1%
GetTimeline_SQLite/events-50-4             218.7µ ±  1%
GetTimeline_SQLite/events-100-4            380.6µ ±  0%
GetTimeline_SQLite/events-500-4            1.650m ±  0%
GetTimeline_SQLite/events-1000-4           3.224m ±  0%
geomean                                    194.5µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                 777.0 ± 10%
EventStoreAppend_SQLite-4                 1.986Ki ±  1%
GetTimeline_InMemory/events-10-4          7.953Ki ±  0%
GetTimeline_InMemory/events-50-4          46.62Ki ±  0%
GetTimeline_InMemory/events-100-4         94.48Ki ±  0%
GetTimeline_InMemory/events-500-4         472.8Ki ±  0%
GetTimeline_InMemory/events-1000-4        944.3Ki ±  0%
GetTimeline_SQLite/events-10-4            16.74Ki ±  0%
GetTimeline_SQLite/events-50-4            87.14Ki ±  0%
GetTimeline_SQLite/events-100-4           175.4Ki ±  0%
GetTimeline_SQLite/events-500-4           846.1Ki ±  0%
GetTimeline_SQLite/events-1000-4          1.639Mi ±  0%
geomean                                   67.26Ki

                                   │ baseline-bench.txt │
                                   │     allocs/op      │
EventStoreAppend_InMemory-4                  7.000 ± 0%
EventStoreAppend_SQLite-4                    53.00 ± 0%
GetTimeline_InMemory/events-10-4             125.0 ± 0%
GetTimeline_InMemory/events-50-4             653.0 ± 0%
GetTimeline_InMemory/events-100-4           1.306k ± 0%
GetTimeline_InMemory/events-500-4           6.514k ± 0%
GetTimeline_InMemory/events-1000-4          13.02k ± 0%
GetTimeline_SQLite/events-10-4               382.0 ± 0%
GetTimeline_SQLite/events-50-4              1.852k ± 0%
GetTimeline_SQLite/events-100-4             3.681k ± 0%
GetTimeline_SQLite/events-500-4             18.54k ± 0%
GetTimeline_SQLite/events-1000-4            37.29k ± 0%
geomean                                     1.162k

Benchmarks run with go test -bench=. -benchmem -count=6.
Regressions ≥ 20% are flagged. Results compared via benchstat.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 64.85356% with 84 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
telemetry/bridge.go 55.90% 47 Missing and 9 partials ⚠️
module/telemetry_bridge.go 63.46% 16 Missing and 3 partials ⚠️
plugins/observability/wiring.go 66.66% 7 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@intel352 intel352 merged commit f3f6a0a into main May 25, 2026
26 checks passed
@intel352 intel352 deleted the feat/observability-core-contracts branch May 25, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant