-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Hook up datadog logger #25
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ yarn-error.log* | |
$ CloudFlare worker | ||
.mf/ | ||
tsconfig.tsbuildinfo | ||
.env | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import { Server as BaseServer } from "reps-do"; | ||
import { DatadogLogger, Server as BaseServer } from "reps-do"; | ||
export { worker as default } from "reps-do"; | ||
import { mutators, type M } from "../src/datamodel/mutators.js"; | ||
|
||
export class Server extends BaseServer<M> { | ||
constructor(state: DurableObjectState) { | ||
super(mutators, state); | ||
constructor(state: DurableObjectState, env: Record<string, string>) { | ||
const logger = new DatadogLogger({ | ||
apiKey: env.DATADOG_API_KEY, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to come from env :'( |
||
service: "replidraw", | ||
}); | ||
|
||
super({ | ||
mutators, | ||
state, | ||
logger, | ||
}); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name = "replidraw-do" | ||
name = "replidraw" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm moving to this name. |
||
type = "javascript" | ||
|
||
account_id = "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can leave this empty and login via wrangler instead. This makes it a bit easier for customers to reuse. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that is correct:
...but you can use environment variables instead:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wfm but I only have one account. |
||
|
@@ -28,3 +28,6 @@ main = "./index.mjs" | |
|
||
[miniflare] | ||
durable_objects_persist = true | ||
|
||
#[secrets] | ||
#DATADOG_API_KEY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must define the env var in here for miniflare to work. See: https://miniflare.dev/core/variables-secrets