-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Motivation We're collecting logs, but we'd like better observability for the relay using dd-trace. ## Change Summary Configure and enable Datadog tracing for the auth relay. ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a changeset - [x] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [x] PR includes documentation if necessary - [x] All commits have been signed
- Loading branch information
1 parent
fb16a2c
commit c4b36cf
Showing
7 changed files
with
376 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@farcaster/auth-relay": minor | ||
--- | ||
|
||
chore: add dd-trace |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import tracer from "dd-trace"; | ||
import { ENVIRONMENT, SERVICE } from "./env"; | ||
|
||
tracer.init({ | ||
env: ENVIRONMENT, | ||
// Service name that appears in the Datadog UI | ||
service: SERVICE, | ||
// Include trace ID in log messages | ||
logInjection: ENVIRONMENT !== "test", | ||
// Collect metrics on NodeJS CPU, memory, heap, event loop delay, GC events, etc. | ||
// See https://docs.datadoghq.com/tracing/runtime_metrics/nodejs#data-collected | ||
// for a list of statsd metrics. | ||
runtimeMetrics: ENVIRONMENT !== "test", | ||
// Log configuration on startup | ||
startupLogs: ENVIRONMENT === "prod", | ||
}); | ||
|
||
tracer.use("fastify", { | ||
enabled: true, | ||
service: SERVICE, | ||
blocklist: ["/healthcheck"], | ||
}); | ||
|
||
tracer.use("ioredis", { | ||
enabled: true, | ||
service: SERVICE, | ||
}); | ||
|
||
tracer.use("redis", { | ||
enabled: true, | ||
service: SERVICE, | ||
}); | ||
|
||
tracer.use("http", { | ||
enabled: true, | ||
service: SERVICE, | ||
}); | ||
|
||
tracer.use("http2", { | ||
enabled: true, | ||
service: SERVICE, | ||
}); | ||
|
||
tracer.use("net", { | ||
enabled: true, | ||
service: SERVICE, | ||
}); | ||
|
||
export default tracer; |
This file contains 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
Oops, something went wrong.