Skip to content

docs.rs CDN: set up tracing & configure datadog logging for application logs - #1196

Merged
marcoieni merged 1 commit into
rust-lang:masterfrom
syphar:docsrs-fastly-logs-compute
Sep 3, 2026
Merged

docs.rs CDN: set up tracing & configure datadog logging for application logs#1196
marcoieni merged 1 commit into
rust-lang:masterfrom
syphar:docsrs-fastly-logs-compute

Conversation

@syphar

@syphar syphar commented Aug 26, 2026

Copy link
Copy Markdown
Member

I think this should be it.

Related links:

Generally:
This just uses the standard tracing json log format, depending on what we want to do in datadog we either need to pre-process these logs in datadog, or rename fields in here.

I'm not sure about the api-key / secret thing, feel free to tell me what should be different.

Also: these are just error / info logs from the wasm module itself. We don't have any access log yet.

Future improvements:

  • start adding request-id, create a surrounding span that includes it so we can see it in the logs.

@syphar
syphar marked this pull request as ready for review August 26, 2026 17:44
@syphar

syphar commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

r? @marcoieni

@syphar
syphar force-pushed the docsrs-fastly-logs-compute branch from 84076f5 to 8777861 Compare August 26, 2026 18:15
@syphar syphar changed the title docs.rs CDN: configure datadog logging for application logs docs.rs CDN: set up tracing & configure datadog logging for application logs Aug 26, 2026
Comment thread terraform/docs-rs/fastly-compute-docs-rs/src/logging.rs Outdated
@syphar
syphar requested a review from marcoieni August 28, 2026 06:34
@marcoieni marcoieni self-assigned this Aug 31, 2026
@syphar
syphar force-pushed the docsrs-fastly-logs-compute branch 2 times, most recently from c972c1d to 335928c Compare September 2, 2026 07:46
Comment thread terraform/docs-rs/fastly.tf Outdated
@syphar
syphar force-pushed the docsrs-fastly-logs-compute branch from 335928c to 012409e Compare September 2, 2026 11:22
@syphar

syphar commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

@syphar
syphar marked this pull request as draft September 2, 2026 11:23
@syphar
syphar force-pushed the docsrs-fastly-logs-compute branch 3 times, most recently from d19f168 to 365b492 Compare September 3, 2026 04:28
@syphar

syphar commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

So, "small" update here.

For now I'm using the help of the tracing-serde crate to build my own tracing layer, and a custom struct for the log format that datadog expects.

Generally I would like to extract that stuff into a separate small crate (tracing-fastly or so), so we (and others) can reuse it.

Comment thread Cargo.toml
"setup-deploy-keys",
"ansible/roles/dev-desktop/files/team_login",
]
exclude = [

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's because our test-suite now only runs with the fastly test-runner, not as normal tests any more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to explicitly exclude the package? If yes, should we also exclude terragrunt/modules/crates-io/compute-static?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like our package needs to be excluded, but the compute-static one not. didn't dig into why yet.

@syphar

syphar commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

so the main reason for all the code in crate::logging is

  • provide the datadog json format
  • collect fields from tracing spans, also emit them on the log.

@syphar
syphar marked this pull request as ready for review September 3, 2026 04:43
Comment thread .github/workflows/main.yml Outdated
@syphar
syphar requested a review from marcoieni September 3, 2026 08:18
Comment thread Cargo.lock Outdated
Comment thread terraform/docs-rs/fastly-compute-docs-rs/Cargo.toml
Comment thread terraform/docs-rs/fastly.tf
@marcoieni

Copy link
Copy Markdown
Member

ok, I will apply this now. You can squash your commits if you want, otherwise I can merge like this.

@syphar
syphar force-pushed the docsrs-fastly-logs-compute branch from 79ee359 to 5d7f3a2 Compare September 3, 2026 09:19
@marcoieni
marcoieni merged commit 3e4642b into rust-lang:master Sep 3, 2026
8 checks passed
@syphar
syphar deleted the docsrs-fastly-logs-compute branch September 3, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants