Grafana datasource plugin for B2C Commerce (Metrics + CIP) with Go SDK#571
Draft
clavery wants to merge 1 commit into
Draft
Grafana datasource plugin for B2C Commerce (Metrics + CIP) with Go SDK#571clavery wants to merge 1 commit into
clavery wants to merge 1 commit into
Conversation
Add a Grafana datasource plugin for B2C Commerce with two datasource types and a standalone Go SDK that powers them: - packages/b2c-tooling-sdk-go — Go SDK (OAuth client-credentials, Metrics REST client with >24h range partitioning + typed HTTPError, CIP Avatica client, tenant/window helpers, tag enrichment with TS↔Go golden parity). - packages/b2c-grafana-datasource — plugin with a Metrics datasource (tiered push-down/label filters, metric multi-select, group-by, discovery) and a CIP SQL datasource built on grafana/sqlds/v4 (Calcite time macros, schema browser, template variables). React query editors; multi-stage Docker demo (mock) + real mode (creds via b2c CLI keychain); merchant + technical dashboards. - b2c-tooling-sdk: tag enrichment refactored to a declarative catalog + golden fixture (shared source of truth for the Go SDK). Correctness/idiom hardening: error-source attribution (429 -> downstream), authoritative RefID keying, idempotent timestamp normalization, sqlds row limits/timeouts. CI runs Go build/vet/test for both modules; catalog parity test guards TS<->Go drift. Both Go modules versioned via git tags. Verified end-to-end against a live instance (Metrics + CIP, dashboards, discovery, variables).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Grafana datasource plugin for B2C Commerce with two datasource types, plus a standalone Go SDK that powers them (and is reusable for other Go tooling). Verified end-to-end against a live instance.
New packages
packages/b2c-tooling-sdk-go— standalone Go SDK (git-tag versioned): OAuth client-credentials auth, a Metrics REST client (with transparent >24h range partitioning + typedHTTPError), a CIP Avatica/protobuf client, tenant/window helpers, and tag enrichment kept byte-parity with the TS SDK via a golden fixture.packages/b2c-grafana-datasource— the plugin (git-tag versioned), shipping two datasource types from one workspace package:grafana/sqlds/v4(the framework the built-in Postgres/MySQL datasources use) —$__timeFilter/$__timeGroup/$__intervalmacros, schema browser, template variables.Also
@salesforce/b2c-tooling-sdk: metrics tag enrichment refactored into a declarative catalog + golden fixture (the shared source of truth the Go SDK consumes). No API change (see changeset).test-gojob builds/vets/tests both Go modules; a catalog-parity test guards TS↔Go drift.Versioning
The Grafana plugin and Go SDK are git-tag versioned (like
b2c-vs-extension), not changesets. The changeset in this PR covers only the@salesforce/b2c-tooling-sdkenrichment change.Manual testing
Requires Docker and the
b2cCLI configured for a B2C instance with the Metrics closed beta enabled and CIP access.In Grafana (http://localhost:3000, anonymous admin):
$__timeGroupAlias(col, $__interval)+$__timeFilter(col)query in both Time series and Table format; use the schema browser and a$sitetemplate variable.make downto tear down.