@saguiitay/eventhouse-ai-observability 0.0.0-stage → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/LICENSE +21 -0
- package/README.md +191 -2
- package/dist/adapters/copilot.d.ts +18 -0
- package/dist/chunk-XQFUPGYU.js +946 -0
- package/dist/chunk-XQFUPGYU.js.map +1 -0
- package/dist/copilot.d.ts +4 -0
- package/dist/copilot.js +474 -0
- package/dist/copilot.js.map +1 -0
- package/dist/diagnostics.d.ts +11 -0
- package/dist/engine.d.ts +55 -0
- package/dist/exporters/eventstream.d.ts +32 -0
- package/dist/exporters/serialize.d.ts +44 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/docs/architecture.md +29 -0
- package/docs/copilot-adapter.md +176 -0
- package/docs/dashboards.md +55 -0
- package/docs/eventstream-transport.md +35 -0
- package/docs/extending.md +33 -0
- package/docs/fabric-setup.md +131 -0
- package/docs/implementation-report.md +101 -0
- package/docs/performance.md +24 -0
- package/docs/quickstart.md +92 -0
- package/docs/research-copilot.md +92 -0
- package/docs/research-eventstream.md +221 -0
- package/docs/research-fabric.md +64 -0
- package/docs/research.md +36 -0
- package/docs/security.md +26 -0
- package/docs/telemetry-schema.md +33 -0
- package/docs/troubleshooting.md +38 -0
- package/examples/README.md +95 -0
- package/examples/copilot-basic/env.example +8 -0
- package/examples/copilot-basic/index.ts +19 -0
- package/examples/copilot-basic/package.json +8 -0
- package/examples/copilot-basic/tsconfig.json +7 -0
- package/examples/copilot-multi-agent/env.example +6 -0
- package/examples/copilot-multi-agent/index.ts +57 -0
- package/examples/copilot-tools/env.example +6 -0
- package/examples/copilot-tools/index.ts +54 -0
- package/examples/shared.ts +142 -0
- package/package.json +77 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.2 - 2026-11-14
|
|
4
|
+
|
|
5
|
+
- Publish to npmjs using GitHub Actions OIDC trusted publishing without a stored
|
|
6
|
+
npm token. Provenance requires a public source repository and is not generated
|
|
7
|
+
for this private repository.
|
|
8
|
+
- Preserve the separate GitHub Packages publishing workflow and registry defaults.
|
|
9
|
+
- Verify packed publication settings and the published npmjs version.
|
|
10
|
+
- Update the basic example's dependency pin and instrumentation scope to 0.1.2.
|
|
11
|
+
- No runtime behavior changes beyond the instrumentation scope version.
|
|
12
|
+
|
|
13
|
+
## 0.1.1 - 2026-11-12
|
|
14
|
+
|
|
15
|
+
- Fix the reported development-dependency advisories by upgrading AJV to 8.18.0
|
|
16
|
+
and fast-uri to 3.1.9.
|
|
17
|
+
- Publish with public access and require verified public GitHub package visibility
|
|
18
|
+
before publication. GitHub's one-time package visibility setting is separate
|
|
19
|
+
from npm's access flag.
|
|
20
|
+
- Derive the package-smoke tarball name from release metadata, and verify packed
|
|
21
|
+
metadata, instrumentation scope version, and the basic example's dependency pin.
|
|
22
|
+
- Update the basic example to consume published 0.1.1 once that version is released.
|
|
23
|
+
- Document successful operator-reported live validation of 0.1.0: installed
|
|
24
|
+
package, Copilot execution, Eventstream acknowledgement, Eventhouse ingestion,
|
|
25
|
+
and dashboard visibility. This does not claim automated live validation of 0.1.1.
|
|
26
|
+
|
|
27
|
+
## 0.1.0 - 2026-11-12
|
|
28
|
+
|
|
29
|
+
- Initial GitHub Packages release with Fabric Eventstream and OTLP export,
|
|
30
|
+
GitHub Copilot SDK instrumentation, privacy filtering, and export diagnostics.
|
|
31
|
+
- Include Fabric schemas, analytics, dashboard assets, provisioning tools,
|
|
32
|
+
three Copilot examples, offline tests, and an opt-in live validation script.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eventhouse AI Observability contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,192 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Five-minute quick start
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Instrument an **existing GitHub Copilot SDK session** and send OpenTelemetry spans directly to Microsoft Fabric Eventstream. No Collector, gateway, or custom frontend.
|
|
4
|
+
|
|
5
|
+
1. In Fabric, add an Eventstream **Custom endpoint source**, then connect its output to an Eventhouse KQL database. Use the source's **Event Hub** producer credentials, not an outward destination. Apply the [schema and setup](docs/fabric-setup.md).
|
|
6
|
+
2. Set `FABRIC_EVENTSTREAM_CONNECTION_STRING` to the Fabric-provided connection string. If it omits `EntityPath`, also set `FABRIC_EVENTSTREAM_ENTITY_NAME` to the provided event hub name.
|
|
7
|
+
3. Install from npmjs (or your organization's approved npm mirror) and instrument:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @saguiitay/eventhouse-ai-observability
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { observeCopilot } from "@saguiitay/eventhouse-ai-observability/copilot";
|
|
15
|
+
|
|
16
|
+
const session = await copilot.createSession(/* your existing configuration */);
|
|
17
|
+
const observer = observeCopilot(session, {
|
|
18
|
+
connectionString: process.env.FABRIC_EVENTSTREAM_CONNECTION_STRING!,
|
|
19
|
+
serviceName: "my-agent",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
await session.sendAndWait({ prompt: "Explain distributed tracing." });
|
|
24
|
+
} finally {
|
|
25
|
+
await observer.shutdown();
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Version 0.1.1 is published to **GitHub Packages**, and its first npmjs release
|
|
30
|
+
was approved by the maintainer. A separate npmjs workflow publishes future
|
|
31
|
+
versions directly using GitHub Actions OIDC trusted publishing.
|
|
32
|
+
To test an unpublished release,
|
|
33
|
+
run `pnpm install` and `pnpm pack`; install the root tarball with npm.
|
|
34
|
+
Node.js **22.15+** (including Node 24 LTS), ESM, Copilot SDK **1.0.31** / compatible
|
|
35
|
+
1.x, and a Fabric capacity/workspace with Eventstream and Eventhouse are required.
|
|
36
|
+
The repository's `.npmrc` routes only `@saguiitay` packages to GitHub Packages;
|
|
37
|
+
other dependencies continue to use your configured, organization-approved registry.
|
|
38
|
+
|
|
39
|
+
Packing with `pnpm pack` or `npm pack` automatically rebuilds the ESM runtime and
|
|
40
|
+
TypeScript declarations through `prepack`; a failed build stops packaging. Do not
|
|
41
|
+
disable lifecycle scripts when preparing a release.
|
|
42
|
+
|
|
43
|
+
The tarball includes these documentation pages and example sources/templates, so
|
|
44
|
+
relative links work from the installed package. Run example/provisioning commands
|
|
45
|
+
from the source checkout; Fabric assets remain there and are not shipped with
|
|
46
|
+
tenant-specific bindings.
|
|
47
|
+
|
|
48
|
+
Metadata only is captured by default. Prompts, responses, tool arguments, tool results, and error messages are not collected unless explicitly enabled. Credentials are redacted; review [security](docs/security.md) before enabling content.
|
|
49
|
+
|
|
50
|
+
## What is included
|
|
51
|
+
|
|
52
|
+
One npm package with root and `/copilot` exports and ordinary internal modules under `src`. OpenTelemetry supplies batching, sampling, and OTLP export; our code supplies the Fabric exporter, privacy filtering, and Copilot event adapter. Includes versioned JSON, Eventhouse schema and twenty analytics queries, native dashboard assets, provisioning, three [examples](examples), local integration tests, and an opt-in live check.
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { createObservability } from "@saguiitay/eventhouse-ai-observability";
|
|
56
|
+
|
|
57
|
+
const observer = createObservability({
|
|
58
|
+
transport: "otlp",
|
|
59
|
+
endpoint: "https://your-existing-otlp-service.example/v1/traces",
|
|
60
|
+
});
|
|
61
|
+
const span = observer.startSpan("invoke_agent my-framework", {
|
|
62
|
+
attributes: { "gen_ai.operation.name": "invoke_agent" },
|
|
63
|
+
});
|
|
64
|
+
span.end();
|
|
65
|
+
await observer.flush();
|
|
66
|
+
await observer.shutdown();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
An OTLP endpoint is optional and **not required for Fabric**. Eventstream receives JSON events over the official Event Hubs AMQP producer protocol, not OTLP.
|
|
70
|
+
|
|
71
|
+
Examples print their selected transport and final export counters, and fail after
|
|
72
|
+
cleanup if telemetry failed or was dropped. In applications, use
|
|
73
|
+
`observer.getDiagnostics().lastError`, `onDiagnostic`, or `debug: true` for safe
|
|
74
|
+
failure categories without exposing credentials. Producer acknowledgements do
|
|
75
|
+
not prove Eventhouse ingestion. Existing Fabric deployments can use the
|
|
76
|
+
[previewable update command](docs/fabric-setup.md#updating-an-existing-deployment)
|
|
77
|
+
to update the helper and dashboard queries without replacing bindings.
|
|
78
|
+
|
|
79
|
+
## Development and verification
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
pnpm install
|
|
83
|
+
pnpm typecheck
|
|
84
|
+
pnpm test
|
|
85
|
+
pnpm build
|
|
86
|
+
pnpm lint
|
|
87
|
+
pnpm validate:fabric
|
|
88
|
+
pnpm bench
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
All SDK and asset/schema tests run in Node/TypeScript with Vitest and Ajv. Fabric provisioning and its mocked REST tests require PowerShell 7.2+; Python is not required.
|
|
92
|
+
|
|
93
|
+
`pnpm test` uses SDK mocks and a real localhost OTLP HTTP receiver. It does **not**
|
|
94
|
+
establish Fabric compatibility. **Live Fabric compatibility: verified for the
|
|
95
|
+
operator's 0.1.0 deployment on 2026-11-12**, based on the operator's reported
|
|
96
|
+
published-package installation, successful Copilot execution, three acknowledged
|
|
97
|
+
spans with no drops/failures, rows in `AIObservabilityTraces`, and dashboard
|
|
98
|
+
visibility. This does not establish support for all tenants, automated
|
|
99
|
+
provisioning, or a live run of 0.1.1. The separate [live validation
|
|
100
|
+
script](docs/quickstart.md#live-fabric-validation) checks producer acceptance,
|
|
101
|
+
Eventhouse ingestion, KQL lookup, and parent-child relationships; its execution
|
|
102
|
+
has not been reported.
|
|
103
|
+
|
|
104
|
+
## Installation from GitHub Packages
|
|
105
|
+
|
|
106
|
+
GitHub's npm registry requires authentication even for public packages. Your
|
|
107
|
+
organization must permit access to `https://npm.pkg.github.com`.
|
|
108
|
+
Add this scope mapping to the consuming project's `.npmrc`:
|
|
109
|
+
|
|
110
|
+
```ini
|
|
111
|
+
@saguiitay:registry=https://npm.pkg.github.com
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Create a personal access token **(classic)** with `read:packages`. In PowerShell 7,
|
|
115
|
+
configure a user-level environment-variable reference instead of using the
|
|
116
|
+
`npm login` endpoint, which may return HTTP 403:
|
|
117
|
+
|
|
118
|
+
```powershell
|
|
119
|
+
$env:GITHUB_PACKAGES_TOKEN = Read-Host "GitHub classic PAT" -MaskInput
|
|
120
|
+
npm config set '//npm.pkg.github.com/:_authToken' '${GITHUB_PACKAGES_TOKEN}' --location=user
|
|
121
|
+
npm install @saguiitay/eventhouse-ai-observability
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Keep credentials in user-level configuration or your CI secret store, never in
|
|
125
|
+
the repository. Set the environment variable again in each new terminal session.
|
|
126
|
+
This scope mapping does not change the registry for dependencies outside `@saguiitay`.
|
|
127
|
+
|
|
128
|
+
## Publishing
|
|
129
|
+
|
|
130
|
+
Run **Publish to GitHub Packages** from the repository's Actions tab on `main`,
|
|
131
|
+
or publish a GitHub Release whose tag matches the package version, such as
|
|
132
|
+
`v0.1.2`. Update `package.json`, the instrumentation scope version in `src/engine.ts`,
|
|
133
|
+
and the basic example's dependency pin before releasing another version; published versions
|
|
134
|
+
cannot be overwritten. Prerelease versions use the `next` dist-tag instead of `latest`.
|
|
135
|
+
|
|
136
|
+
The workflow first verifies that the existing GitHub package is public, then
|
|
137
|
+
validates, builds via `prepack`, smoke-tests the tarball, publishes that exact
|
|
138
|
+
artifact with `--access public`, and checks its registry version. It uses the repository's
|
|
139
|
+
`GITHUB_TOKEN` with `packages: write`; no npm token or personal access token secret
|
|
140
|
+
is needed for publishing. Repository/organization Actions policy must allow this
|
|
141
|
+
permission.
|
|
142
|
+
|
|
143
|
+
GitHub controls visibility separately from npm's access flag. Before the next
|
|
144
|
+
publication, open the existing package's **Package settings → Change visibility**
|
|
145
|
+
and select **Public**. This is a one-time, irreversible setting; all subsequent
|
|
146
|
+
versions of this package remain public. The workflow fails before publishing if
|
|
147
|
+
the package is private or its visibility cannot be verified. New package names
|
|
148
|
+
must be bootstrapped and made public before using this workflow.
|
|
149
|
+
Public visibility still requires consumer authentication. See the [release notes](CHANGELOG.md).
|
|
150
|
+
|
|
151
|
+
## Publishing to npmjs
|
|
152
|
+
|
|
153
|
+
The separate **Publish to npmjs** workflow runs manually on `main`. It uses
|
|
154
|
+
Node 24 and npm 12, validates the project, changes the registry only in its runner
|
|
155
|
+
checkout, packs, smoke-tests, and publishes the exact tested tarball.
|
|
156
|
+
It then verifies the published version against the public registry. The committed
|
|
157
|
+
GitHub Packages registry configuration and its publishing workflow are unchanged.
|
|
158
|
+
Packed metadata is checked against the selected publication settings.
|
|
159
|
+
OIDC works with this private source repository, but npm provenance attestations
|
|
160
|
+
require a public source repository and are not generated here.
|
|
161
|
+
|
|
162
|
+
Configure the npm package's **Settings > Trusted publishing** with:
|
|
163
|
+
|
|
164
|
+
| Field | Value |
|
|
165
|
+
| -------------------- | --------------------------- |
|
|
166
|
+
| Provider | GitHub Actions |
|
|
167
|
+
| Organization or user | `saguiitay` |
|
|
168
|
+
| Repository | `ai-observability` |
|
|
169
|
+
| Workflow filename | `publish-npmjs.yml` |
|
|
170
|
+
| Environment | Leave blank |
|
|
171
|
+
| Allowed actions | Enable direct `npm publish` |
|
|
172
|
+
|
|
173
|
+
The workflow grants `id-token: write` to its publishing job and does not use
|
|
174
|
+
`NPM_STAGING_TOKEN` or another stored npm credential. A new trusted publisher
|
|
175
|
+
must complete its first successful publication within two days. After that
|
|
176
|
+
publication succeeds, revoke the bootstrap staging token on npmjs and delete
|
|
177
|
+
the repository's `NPM_STAGING_TOKEN` secret. Enable npm's **Require two-factor
|
|
178
|
+
authentication and disallow tokens** publishing setting.
|
|
179
|
+
|
|
180
|
+
Update the release versions described above before running this workflow;
|
|
181
|
+
published versions cannot be overwritten. Running it publishes immediately,
|
|
182
|
+
without a separate npm approval. The first npmjs release was bootstrapped using
|
|
183
|
+
staged publishing and interactive 2FA approval. See
|
|
184
|
+
[npm trusted publishing](https://docs.npmjs.com/trusted-publishers/).
|
|
185
|
+
|
|
186
|
+
When installing from this source checkout, its `.npmrc` still maps `@saguiitay`
|
|
187
|
+
to GitHub Packages. Override that mapping in a consuming project to use npmjs
|
|
188
|
+
or your approved mirror instead; GitHub authentication is not needed for npmjs.
|
|
189
|
+
|
|
190
|
+
## Documentation
|
|
191
|
+
|
|
192
|
+
[Quickstart](docs/quickstart.md) · [Architecture](docs/architecture.md) · [Research](docs/research.md) · [Fabric setup](docs/fabric-setup.md) · [Transport](docs/eventstream-transport.md) · [Schema](docs/telemetry-schema.md) · [Copilot adapter](docs/copilot-adapter.md) · [Dashboards](docs/dashboards.md) · [Security](docs/security.md) · [Extending](docs/extending.md) · [Troubleshooting](docs/troubleshooting.md) · [Performance](docs/performance.md) · [Implementation report](docs/implementation-report.md).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SessionEventHandler } from "@github/copilot-sdk";
|
|
2
|
+
import type { Diagnostics, Observability } from "../engine.js";
|
|
3
|
+
/** Compatible with CopilotSession without requiring its private implementation. */
|
|
4
|
+
export interface CopilotEventSource {
|
|
5
|
+
readonly sessionId: string;
|
|
6
|
+
on(handler: SessionEventHandler): () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface CopilotObserver {
|
|
9
|
+
flush(): Promise<void>;
|
|
10
|
+
shutdown(): Promise<void>;
|
|
11
|
+
getDiagnostics(): Readonly<Diagnostics>;
|
|
12
|
+
}
|
|
13
|
+
export interface AttachCopilotOptions {
|
|
14
|
+
/** Defaults to true. Use false when several adapters share an externally owned engine. */
|
|
15
|
+
shutdownEngine?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Attaches synchronously; event callbacks never perform or await network I/O. */
|
|
18
|
+
export declare function attachCopilot(session: CopilotEventSource, engine: Observability, options?: AttachCopilotOptions): CopilotObserver;
|