connector-observability
Plan and implement logging, metrics, and evaluation visibility for Glean Indexing SDK connectors. Use when wiring connector runtime observability or deciding what to verify after a connector run.
- License 许可
- MIT
- 最近更新
- 2026-10-31
- Stars
- ★ 10
- Forks
- 2
01 前言 Front Matter
- name
- connector-observability
- description
- Plan and implement logging, metrics, and evaluation visibility for Glean Indexing SDK connectors. Use when wiring connector runtime observability or deciding what to verify after a connector run.
03 SKILL.md 正文
Connector Observability
Use this skill when adding runtime visibility to an AI-built connector or when planning the eval/reporting portion of a connector build.
Inputs
<connector-folder>/.glean/connector_plan.md<connector-folder>/.glean/source_investigation.md<connector-folder>/.glean/api_endpoints.json- The generated connector/data-client files
Rules
- Use SDK observability APIs only. Do not invent logging/metrics helpers.
- Keep logs structured and secret-free.
- Never log raw source API tokens, Glean indexing tokens, cookies, or request bodies that may contain customer content.
- Prefer connector-level lifecycle, fetch, transform, upload, status, and failure visibility over noisy per-record logs.
- Record the observability plan in
<connector-folder>/.glean/connector_plan.mdbefore implementation.
SDK Observability Surface
Use these exports from glean.indexing.observability:
ConnectorObservability: central runtime object for common fields, lifecycle logs, phase logs, upload logs, and metrics.setup_connector_logging: configures structured logging for a connector logger.StructuredFormatterandCompactStructuredFormatter: structured console/log formatting.ConsoleLoggerProvider: default local logging provider.MetricsProviderandMetricType: custom metrics backend interface.NoOpMetricsProvider: default no-op metrics provider.InMemoryMetricsProvider: test/development metrics provider.with_observability: decorator for method-level observability when appropriate.track_crawl_progress: decorator/helper for crawl progress logging when appropriate.PerformanceTracker: timing helper for local performance tracking.
If the connector uses PushUploader, pass a ConnectorObservability instance through its observability parameter so upload/batch events are logged and metrics are emitted by the SDK wrapper.
What To Instrument
Plan and implement visibility for:
- Crawl lifecycle: started, completed, failed.
- Source fetch: started, completed, item count, duration, source endpoint or entity type.
- Transform: input count, output count, duration, filtered/skipped count when known.
- Upload: batch start, batch completion, batch failure, batch size, upload ID.
- API behavior: request count, latency, retry count, error count when available through SDK methods.
- Evaluation: status checks run after upload and their results.
Glean Status And Debug Checks
Use connector-push for the allowed status/debug surface. The observability plan should say which of these will run after a test upload:
StatusClient.get_datasource_statusStatusClient.get_documents_statusStatusClient.check_document_accessPushUploader.get_document_lifecycle_eventsPushUploader.debug_user
Do not call undocumented status or debug endpoints directly.
Required Plan Fields
Before implementation, ensure <connector-folder>/.glean/connector_plan.md includes:
- Observability provider choice: console/no-op/in-memory/custom.
- Lifecycle events to log.
- Source fetch and transform counts to report.
- Upload metrics and batch events to report.
- Status/debug checks to run during evaluation.
- Secret-redaction expectations.
Local Evaluation Guidance
For a credential-free planning eval, the plan should describe the observability that will be wired later. Do not require live metrics backends.
For an implementation eval with credentials, verify:
- Generated Python compiles.
- Connector run emits lifecycle/fetch/transform/upload logs.
- Upload status/debug checks are attempted only when Glean indexing credentials are available.
- No secret values appear in logs or
.glean/artifacts.
04 同仓库更多 Skills
connector-testing
Test a generated connector through full-mock, integration/cache, and live end-to-end phases using the public utilities under glean.indexing.testing.
connector-push
Implement Glean-side push/upload logic for Glean Indexing SDK connectors. Use when mapping source entities to Glean documents, identities, groups, memberships, and status checks.
connector-pull
Implement source-side pull logic for Glean Indexing SDK connectors. Use after API exploration when writing data clients that fetch from third-party APIs.
connector-deployment
Plan and operate customer-hosted deployment for Glean Indexing SDK connectors using glean-idx deploy. Use when the user wants deployment artifacts, cloud secrets, Kubernetes CronJobs, logs, status, or teardown for a generated connector.
connector-builder
Build Glean Indexing SDK connectors from source-system documentation. Use when planning, generating, validating, or evaluating a custom connector built with the Glean Indexing SDK.
connector-auth
Plan source API authentication for Glean Indexing SDK connectors. Use during connector planning and implementation to separate API-exploration credentials from production connector auth.