Skip to content

Commit

Permalink
Moved Honeycomb API key to an ignore Git file
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklafrance committed Jan 18, 2025
1 parent fb964fe commit f851e36
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
dist
apiKeys.js
.pnpm-debug.log*
.netlify
.turbo
Expand Down
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,35 @@ To install the dependencies of this repository, open a terminal at the root of t
pnpm install
```

### Setup Honeycomb

[Honeycomb](https://www.honeycomb.io/) is one of the monitoring platforms used at Workleap. The [endpoints](./samples/endpoints/) sample application of this repository is already configured to send traces to Honeycomb but needs a valid Honeycomb API key.

First, create a file named `apikeys` at the root of [samples](./samples/) folder.

``` !#3
workspace
├── samples
├──── apiKeys.js
```

Then, retrieve a valid [Honeycomb API Key](https://docs.honeycomb.io/get-started/configure/environments/manage-api-keys/) from your Vault (or ask IT).

Finally, open the newly created `apiKeys.js` file and export an `HoneycombApiKey` constant with the API key as value.

```js samples/apiKeys.js
export const HoneycombApiKey = "YOUR_API_KEY";
```

If you don't have access to a Honeycomb API Key but still want to run the [endpoints](./samples/endpoints/) sample, create the `apiKeys.js` file as described above and set the `HoneycombApiKey` to an empty string.

```js samples/apiKeys.js
export const HoneycombApiKey = " ";
```

> [!NOTE]
> The `samples/endpoints/apiKeys.js` is ignored by Git and will not be pushed to the remote repository.
### Setup Retype

[Retype](https://retype.com/) is the documentation platform that Squide is using for its documentation. As this project is leveraging a few [Pro features](https://retype.com/pro/) of Retype.
Expand Down
3 changes: 2 additions & 1 deletion samples/endpoints/express-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
import { NodeSDK } from "@opentelemetry/sdk-node";
import cors from "cors";
import express, { type Request, type Response } from "express";
import { HoneycombApiKey } from "../../apiKeys.js";

const sdk = new NodeSDK({
serviceName: "squide-endpoints-sample",
traceExporter: new OTLPTraceExporter({
url: "https://api.honeycomb.io/v1/traces",
headers: {
"x-honeycomb-team": "xSffNa6OhKeROIg9aG6uAB"
"x-honeycomb-team": HoneycombApiKey
}
}),
instrumentations: [
Expand Down
5 changes: 2 additions & 3 deletions samples/endpoints/host/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ConsoleLogger, FireflyRuntime, RuntimeContext, bootstrap } from "@squid
import { registerHoneycombInstrumentation } from "@squide/firefly-honeycomb";
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { HoneycombApiKey } from "../../apiKeys.js";
import { Remotes } from "../remotes.ts";
import { App } from "./App.tsx";
import { registerHost } from "./register.tsx";
Expand All @@ -16,10 +17,8 @@ const runtime = new FireflyRuntime({
loggers: [x => new ConsoleLogger(x)]
});

console.log("TOTO!!!");

registerHoneycombInstrumentation(runtime, "squide-endpoints-sample", [/http:\/\/localhost:1234\.*/], {
apiKey: "xSffNa6OhKeROIg9aG6uAB"
apiKey: HoneycombApiKey
});

await bootstrap(runtime, {
Expand Down

0 comments on commit f851e36

Please sign in to comment.