#
registerHoneycombInstrumentation
Initialize an instance of Honeycomb Web SDK and registers custom instrumentation to monitor the performance of a Squide application.
This function serves as a wrapper around the @workleap/honeycomb library. Before using it, read the documentation for the registerHoneycombInstrumentation function provided by @workleap/honeycomb
.
#
Reference
registerHoneycombInstrumentation(runtime, serviceName, apiServiceUrls: [string | Regex], options?: {})
#
Parameters
runtime
: AFireflyRuntime
instance.serviceName
: Honeycomb application service name.apiServiceUrls
: ARegExp
orstring
that matches the URLs of the application's backend services. If unsure, use the temporary regex/.+/g,
to match all URLs.options
: An optional object literal of options:- Accepts most of the predefined options of the registerHoneycombInstrumentation function provided by
@workleap/honeycomb
. debug
: An optionalboolean
value indicating whether or not to log debug information to the console.true
by default when the runtime mode is set todevelopment
.
- Accepts most of the predefined options of the registerHoneycombInstrumentation function provided by
#
Returns
Nothing
#
Usage
#
Register instrumentation
import { FireflyRuntime } from "@squide/firefly";
import { registerHoneycombInstrumentation } from "@squide/firefly-honeycomb";
const runtime = new FireflyRuntime();
registerHoneycombInstrumentation(runtime, "squide-sample", [/.+/g,], {
endpoint: "https://squide-collector"
});
#
Use an API key
Prefer using an OpenTelemetry collector over an ingestion API key, as API keys can expose Workleap to potential attacks.
import { registerHoneycombInstrumentation } from "@squide/firefly-honeycomb";
registerHoneycombInstrumentation(runtime, "squide-sample", [/.+/g,], {
apiKey: "xyz123"
});
#
Customize backend URLs
Avoid using /.+/g,
in production as it could expose customer data to third parties.
Specify values for the apiServiceUrls
argument that matches your application's backend URLs. For example, if your backend services are hosted at https://workleap.com/api
:
import { registerHoneycombInstrumentation } from "@squide/firefly-honeycomb";
registerHoneycombInstrumentation(
runtime, "squide-sample",
[/https:\/\/workleap.com\/api\.*/],
{ endpoint: "https://squide-collector" }
);