From 61d2248dc7acb7713e6baf3dc2efa2e683b9dbe6 Mon Sep 17 00:00:00 2001 From: patricklafrance Date: Mon, 4 Nov 2024 18:15:34 -0500 Subject: [PATCH] More stuff --- .changeset/pretty-plants-dress.md | 13 +++++++++++++ .changeset/swift-foxes-tickle.md | 12 ++++++++++++ docs/guides/setup-honeycomb.md | 2 +- packages/firefly-honeycomb/package.json | 3 +-- packages/firefly-honeycomb/src/activeSpan.ts | 2 +- packages/firefly/tests/AppRouterReducer.test.tsx | 15 --------------- samples/endpoints/express-server/package.json | 2 +- 7 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 .changeset/pretty-plants-dress.md create mode 100644 .changeset/swift-foxes-tickle.md diff --git a/.changeset/pretty-plants-dress.md b/.changeset/pretty-plants-dress.md new file mode 100644 index 000000000..e425418ec --- /dev/null +++ b/.changeset/pretty-plants-dress.md @@ -0,0 +1,13 @@ +--- +"@squide/firefly-webpack-configs": minor +"@squide/module-federation": minor +"@squide/webpack-configs": minor +"@squide/react-router": minor +"@squide/env-vars": minor +"@squide/firefly": minor +"@squide/i18next": minor +"@squide/core": minor +"@squide/msw": minor +--- + +Now dispatching events to enable instrumentation packages for observability platforms. diff --git a/.changeset/swift-foxes-tickle.md b/.changeset/swift-foxes-tickle.md new file mode 100644 index 000000000..629191876 --- /dev/null +++ b/.changeset/swift-foxes-tickle.md @@ -0,0 +1,12 @@ +--- +"@squide/firefly-honeycomb": major +--- + +New package instrumentating Squide for [Honeycomb](https://www.honeycomb.io/). + +This packages includes: + +- [registerHoneycombInstrumentation](https://gsoft-inc.github.io/wl-squide/reference/honeycomb/registerhoneycombinstrumentation/) +- [setGlobalSpanAttributes](https://gsoft-inc.github.io/wl-squide/reference/honeycomb/setglobalspanattributes/) + +A [migration guide](https://gsoft-inc.github.io/wl-squide/upgrading/migrate-to-firefly-v9.3) is available to update a Squide application to v9.3 and use Honeycomb observability. diff --git a/docs/guides/setup-honeycomb.md b/docs/guides/setup-honeycomb.md index 56dd8805d..5048a82c4 100644 --- a/docs/guides/setup-honeycomb.md +++ b/docs/guides/setup-honeycomb.md @@ -10,7 +10,7 @@ Before going forward with this guide, make sure that you migrated to [v9.3](../u To monitor application performance, Workleap has adopted [Honeycomb](https://www.honeycomb.io/), a tool that helps teams manage and analyze telemetry data from distributed systems. Built on OpenTelemetry, Honeycomb provides a [robust API](https://open-telemetry.github.io/opentelemetry-js/) for tracking frontend telemetry. -Honeycomb's in-house [HoneycombWebSDK](https://docs.honeycomb.io/send-data/javascript-browser/honeycomb-distribution/) includes great default instrumentation. However, this instrumentation has to be extended to capture traces specific to Squide features. To facilitate this, Squide provides the `registerHoneycombInstrumentation` function from the [@squide/firefly-honeycomb]() package. +Honeycomb's in-house [HoneycombWebSDK](https://docs.honeycomb.io/send-data/javascript-browser/honeycomb-distribution/) includes great default instrumentation. However, this instrumentation has to be extended to capture traces specific to Squide features. To facilitate this, Squide provides the `registerHoneycombInstrumentation` function. ## Setup the host application diff --git a/packages/firefly-honeycomb/package.json b/packages/firefly-honeycomb/package.json index 42b9b84f5..477984597 100644 --- a/packages/firefly-honeycomb/package.json +++ b/packages/firefly-honeycomb/package.json @@ -37,14 +37,13 @@ }, "devDependencies": { "@opentelemetry/instrumentation": "*", - "@opentelemetry/instrumentation-fetch": "*", "@opentelemetry/instrumentation-document-load": "*", + "@opentelemetry/instrumentation-fetch": "*", "@opentelemetry/instrumentation-user-interaction": "*", "@opentelemetry/instrumentation-xml-http-request": "*", "@opentelemetry/sdk-trace-web": "*", "@swc/core": "1.7.26", "@swc/jest": "0.2.36", - "@testing-library/react": "16.0.1", "@types/jest": "29.5.13", "@types/uuid": "10.0.0", "@workleap/eslint-plugin": "3.2.2", diff --git a/packages/firefly-honeycomb/src/activeSpan.ts b/packages/firefly-honeycomb/src/activeSpan.ts index 9cdf330b6..a3840465e 100644 --- a/packages/firefly-honeycomb/src/activeSpan.ts +++ b/packages/firefly-honeycomb/src/activeSpan.ts @@ -1,6 +1,6 @@ import type { Span } from "@opentelemetry/api"; import type { FetchCustomAttributeFunction } from "@opentelemetry/instrumentation-fetch"; -import type { RuntimeLogger } from "@squide/core"; +import type { RuntimeLogger } from "@squide/firefly"; import { v4 as uuidv4 } from "uuid"; declare global { diff --git a/packages/firefly/tests/AppRouterReducer.test.tsx b/packages/firefly/tests/AppRouterReducer.test.tsx index 779c09eed..41562bec2 100644 --- a/packages/firefly/tests/AppRouterReducer.test.tsx +++ b/packages/firefly/tests/AppRouterReducer.test.tsx @@ -407,21 +407,6 @@ describe("useAppRouterReducer", () => { expect(result.current[0].deferredRegistrationsUpdatedAt).toEqual(Date.parse("2020-02-14")); }); - // test.only("when \"active-route-is-protected\" is dispatched, \"isActiveRouteProtected\" is true", () => { - // const runtime = new FireflyRuntime(); - - // const { result } = renderUseAppRouterReducerHook(runtime, false, false, false); - - // expect(result.current[0].isActiveRouteProtected).toBeFalsy(); - - // act(() => { - // // dispatch - // result.current[1]({ type: "active-route-is-protected" }); - // }); - - // expect(result.current[0].isActiveRouteProtected).toBeTruthy(); - // }, 50000); - test("when \"active-route-is-public\" is dispatched, \"activeRouteVisiblity\" is \"public\"", () => { const runtime = new FireflyRuntime(); diff --git a/samples/endpoints/express-server/package.json b/samples/endpoints/express-server/package.json index b80c80af7..986d86126 100644 --- a/samples/endpoints/express-server/package.json +++ b/samples/endpoints/express-server/package.json @@ -13,8 +13,8 @@ "@opentelemetry/api": "1.9.0", "@opentelemetry/auto-instrumentations-node": "0.51.0", "@opentelemetry/exporter-trace-otlp-http": "0.53.0", - "@opentelemetry/instrumentation-http": "0.53.0", "@opentelemetry/instrumentation-express": "0.43.0", + "@opentelemetry/instrumentation-http": "0.53.0", "@opentelemetry/sdk-node": "0.53.0", "cors": "2.8.5", "express": "4.21.1"