diff --git a/content/en/serverless/google_cloud_run/containers.md b/content/en/serverless/google_cloud_run/containers/_index.md
similarity index 90%
rename from content/en/serverless/google_cloud_run/containers.md
rename to content/en/serverless/google_cloud_run/containers/_index.md
index a1146e10ce832..7283618146cdf 100644
--- a/content/en/serverless/google_cloud_run/containers.md
+++ b/content/en/serverless/google_cloud_run/containers/_index.md
@@ -1,5 +1,5 @@
---
-title: Choosing an Instrumentation Method for Google Cloud Run Containers
+title: Choosing an Instrumentation Method for Containers
further_reading:
- link: "/integrations/google-cloud-run/"
tag: "Documentation"
@@ -7,10 +7,10 @@ further_reading:
- link: 'https://www.datadoghq.com/blog/collect-traces-logs-from-cloud-run-with-datadog/'
tag: 'Blog'
text: 'Collect traces, logs, and custom metrics from Cloud Run services'
- - link: "/serverless/google_cloud_run/containers_in_process/"
+ - link: "/serverless/google_cloud_run/containers/in_process/"
tag: 'Documentation'
text: 'Instrument your container with the in-process approach'
- - link: "/serverless/google_cloud_run/containers_sidecar/"
+ - link: "/serverless/google_cloud_run/containers/sidecar/"
tag: 'Documentation'
text: 'Instrument your container with the sidecar approach'
---
@@ -19,7 +19,7 @@ To instrument your Google Cloud Run containers with Datadog, choose one of two o
{{% google-cloud-run-container-options %}}
-- [**In-process**][1]: Wraps your application container with the Datadog Agent. Choose this option for a simpler setup, lower cost overhead, and direct log piping.
+- [**In-process**][1]: Wraps your application container with the Datadog Agent. Choose this option for a simpler setup, lower cost overhead, and direct log piping.
- [**Sidecar**][2]: Deploys the Datadog Agent in a separate container alongside your app container. Choose this option if you have multiple containers in a single service, if you prefer strict isolation of the Datadog Agent, or if you have performance-sensitive workloads.
## Comparison: in-process versus sidecar instrumentation
@@ -38,5 +38,5 @@ To instrument your Google Cloud Run containers with Datadog, choose one of two o
{{< partial name="whats-next/whats-next.html" >}}
-[1]: /serverless/google_cloud_run/containers_in_process
-[2]: /serverless/google_cloud_run/containers_sidecar
\ No newline at end of file
+[1]: /serverless/google_cloud_run/containers/in_process
+[2]: /serverless/google_cloud_run/containers/sidecar
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/_index.md b/content/en/serverless/google_cloud_run/containers/in_process/_index.md
new file mode 100644
index 0000000000000..ea21b8f8a3cd3
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/_index.md
@@ -0,0 +1,14 @@
+---
+title: In-Process Instrumentation
+type: multi-code-lang
+aliases:
+ - /serverless/google_cloud_run/containers_in_process/
+---
+
+First, set up the **[Google Cloud Integration][1]** to collect metrics and logs from Google Cloud services. Remember to add the `cloud asset viewer` role to your service account and enable the Cloud Asset Inventory API in Google Cloud.
+
+Then, instrument your application using one of the following guides:
+
+{{< partial name="serverless/in-process-languages.html" >}}
+
+[1]: /integrations/google-cloud-platform/
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/dotnet.md b/content/en/serverless/google_cloud_run/containers/in_process/dotnet.md
new file mode 100644
index 0000000000000..b74e0d73131d4
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/dotnet.md
@@ -0,0 +1,80 @@
+---
+title: Instrumenting a .NET Cloud Run Container In-Process
+code_lang: dotnet
+type: multi-code-lang
+code_lang_weight: 50
+further_reading:
+ - link: '/tracing/trace_collection/automatic_instrumentation/dd_libraries/dotnet-core/?tab=linux'
+ tag: 'Documentation'
+ text: 'Tracing .NET Core Applications'
+ - link: '/tracing/other_telemetry/connect_logs_and_traces/dotnet/'
+ tag: 'Documentation'
+ text: 'Correlating .NET Logs and Traces'
+---
+
+## Setup
+1. **Install the Datadog .NET tracer** in your Dockerfile.
+
+ Because GitHub requests are rate limited, you must pass a GitHub token saved in the environment variable `GITHUB_TOKEN` as a [Docker build secret][1] `--secret id=github-token,env=GITHUB_TOKEN`.
+
+ {{< tabs >}}
+ {{% tab "Linux/AMD64" %}}
+{{< code-block lang="dockerfile" filename="Dockerfile" disable_copy="false" collapsible="true" >}}
+RUN --mount=type=secret,id=github-token,env=GITHUB_TOKEN \
+ chmod +x /app/dotnet.sh && /app/dotnet.sh
+{{< /code-block >}}
+ {{% /tab %}}
+
+ {{% tab "Alpine" %}}
+{{< code-block lang="dockerfile" filename="Dockerfile" disable_copy="false" collapsible="true" >}}
+# For alpine use datadog-dotnet-apm-2.57.0-musl.tar.gz
+ARG TRACER_VERSION
+ADD https://github.com/DataDog/dd-trace-dotnet/releases/download/v${TRACER_VERSION}/datadog-dotnet-apm-${TRACER_VERSION}.tar.gz /tmp/datadog-dotnet-apm.tar.gz
+
+RUN mkdir -p /dd_tracer/dotnet/ && tar -xzvf /tmp/datadog-dotnet-apm.tar.gz -C /dd_tracer/dotnet/ && rm /tmp/datadog-dotnet-apm.tar.gz
+{{< /code-block >}}
+ {{% /tab %}}
+ {{< /tabs >}}
+
+ For more information, see [Tracing .NET applications][2].
+
+2. **Install serverless-init**.
+
+ {{% gcr-install-serverless-init cmd="\"dotnet\", \"dotnet.dll\"" %}}
+
+3. **Set up logs**.
+
+ To enable logging, set the environment variable `DD_LOGS_ENABLED=true`. This allows `serverless-init` to read logs from stdout and stderr.
+
+ Datadog also recommends setting the environment variable `DD_SOURCE=csharp` to enable advanced Datadog log parsing.
+
+ If you want multiline logs to be preserved in a single log message, Datadog recommends writing your logs in JSON format. For example, you can use a third-party logging library such as `Serilog`:
+
+ {{< code-block lang="csharp" disable_copy="false" >}}
+using Serilog;
+
+builder.Host.UseSerilog((context, config) =>
+{
+ config.WriteTo.Console(new Serilog.Formatting.Json.JsonFormatter(renderMessage: true));
+});
+
+logger.LogInformation("Hello World!");
+{{< /code-block >}}
+
+ For more information, see [Correlating .NET Logs and Traces][3].
+
+4. **Configure your application**.
+
+{{% gcr-configure-env-vars language="csharp" %}}
+
+## Troubleshooting
+
+{{% gcr-troubleshooting %}}
+
+## Further reading
+
+{{< partial name="whats-next/whats-next.html" >}}
+
+[1]: https://docs.docker.com/build/building/secrets/
+[2]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/dotnet-core/?tab=linux
+[3]: /tracing/other_telemetry/connect_logs_and_traces/dotnet/
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/go.md b/content/en/serverless/google_cloud_run/containers/in_process/go.md
new file mode 100644
index 0000000000000..6e9ca2c710b59
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/go.md
@@ -0,0 +1,75 @@
+---
+title: Instrumenting a Go Cloud Run Container In-Process
+code_lang: go
+type: multi-code-lang
+code_lang_weight: 30
+further_reading:
+ - link: '/tracing/trace_collection/automatic_instrumentation/dd_libraries/go/'
+ tag: 'Documentation'
+ text: 'Tracing Go Applications'
+ - link: '/tracing/other_telemetry/connect_logs_and_traces/go/'
+ tag: 'Documentation'
+ text: 'Correlating Go Logs and Traces'
+---
+
+## Setup
+1. **Install the Datadog Go tracer**.
+
+ 1. In your main application, add the tracing library from `dd-trace-go`.
+
+ {{< code-block lang="shell" disable_copy="false" >}}
+go get github.com/DataDog/dd-trace-go/v2/ddtrace/tracer
+{{< /code-block >}}
+
+ 2. Add the following to your application code to initialize the tracer:
+ {{< code-block lang="go" disable_copy="false" >}}
+tracer.Start()
+defer tracer.Stop()
+{{< /code-block >}}
+
+ You can also add additional packages:
+ {{< code-block lang="shell" disable_copy="false" >}}
+# Enable Profiling
+go get github.com/DataDog/dd-trace-go/v2/profiler
+
+# Patch /net/http
+go get github.com/DataDog/dd-trace-go/contrib/net/http/v2
+{{< /code-block >}}
+
+ For more information, see [Tracing Go Applications][1] and the [Tracer README][2].
+
+2. **Install serverless-init**.
+
+ {{% gcr-install-serverless-init cmd="./your-binary" %}}
+
+3. **Set up logs**.
+
+ To enable logging, set the environment variable `DD_LOGS_ENABLED=true`. This allows `serverless-init` to read logs from stdout and stderr.
+
+ Datadog also recommends setting the environment variable `DD_SOURCE=go` to enable advanced Datadog log parsing.
+
+ If you want multiline logs to be preserved in a single log message, Datadog recommends writing your logs in JSON format. For example, you can use a third-party logging library such as `logrus`:
+ ```go
+ logrus.SetFormatter(&logrus.JSONFormatter{})
+ logrus.AddHook(&dd_logrus.DDContextLogHook{})
+
+ logrus.WithContext(ctx).Info("Hello World!")
+ ```
+
+ For more information, see [Correlating Go Logs and Traces][3].
+
+4. **Configure your application**.
+
+{{% gcr-configure-env-vars language="go" %}}
+
+## Troubleshooting
+
+{{% gcr-troubleshooting %}}
+
+## Further reading
+
+{{< partial name="whats-next/whats-next.html" >}}
+
+[1]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/go/
+[2]: https://github.com/DataDog/dd-trace-go?tab=readme-ov-file#installing
+[3]: /tracing/other_telemetry/connect_logs_and_traces/go/
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/java.md b/content/en/serverless/google_cloud_run/containers/in_process/java.md
new file mode 100644
index 0000000000000..047b08e060ea1
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/java.md
@@ -0,0 +1,89 @@
+---
+title: Instrumenting a Java Cloud Run Container In-Process
+code_lang: java
+type: multi-code-lang
+code_lang_weight: 40
+further_reading:
+ - link: '/tracing/trace_collection/automatic_instrumentation/dd_libraries/java/'
+ tag: 'Documentation'
+ text: 'Tracing Java Applications'
+ - link: '/tracing/other_telemetry/connect_logs_and_traces/java/'
+ tag: 'Documentation'
+ text: 'Correlating Java Logs and Traces'
+---
+
+## Setup
+1. **Install the Datadog Java tracer**.
+
+ 1. Add the Datadog Java tracer to your Dockerfile:
+
+ {{< code-block lang="dockerfile" filename="Dockerfile" disable_copy="false" collapsible="true" >}}
+ADD 'https://dtdg.co/latest-java-tracer' agent.jar
+ENV JAVA_TOOL_OPTIONS="-javaagent:agent.jar"
+{{< /code-block >}}
+
+ 2. Add the tracer artifacts.
+ {{< tabs >}}
+ {{% tab "Maven" %}}
+{{< code-block lang="xml" disable_copy="false" >}}
+
+ com.datadoghq
+ dd-trace-api
+ DD_TRACE_JAVA_VERSION_HERE
+
+{{< /code-block >}}
+ {{% /tab %}}
+
+ {{% tab "Gradle" %}}
+{{< code-block lang="groovy" disable_copy="false" >}}
+implementation 'com.datadoghq:dd-trace-api:DD_TRACE_JAVA_VERSION_HERE'
+{{< /code-block >}}
+ {{% /tab %}}
+ {{< /tabs >}}
+
+ 3. Add the `@Trace` annotation to any method you want to trace.
+
+ For more information, see [Tracing Java Applications][1].
+
+2. **Install serverless-init**.
+
+ {{% gcr-install-serverless-init cmd="\"./mvnw\", \"spring-boot:run\"" %}}
+
+3. **Set up logs**.
+
+ To enable logging, set the environment variable `DD_LOGS_ENABLED=true`. This allows `serverless-init` to read logs from stdout and stderr.
+
+ Datadog also recommends setting the environment variable `DD_SOURCE=java` to enable advanced Datadog log parsing.
+
+ If you want multiline logs to be preserved in a single log message, Datadog recommends writing your logs in *compact* JSON format. For example, you can use a third-party logging library such as `Log4j 2`:
+
+ {{< code-block lang="java" disable_copy="false" >}}
+private static final Logger logger = LogManager.getLogger(App.class);
+logger.info("Hello World!");
+{{< /code-block >}}
+
+ {{< code-block lang="xml" filename="resources/log4j2.xml" disable_copy="false" >}}
+
+
+
+
+
+
+{{< /code-block >}}
+
+ For more information, see [Correlating Java Logs and Traces][2].
+
+4. **Configure your application**.
+
+{{% gcr-configure-env-vars language="java" %}}
+
+## Troubleshooting
+
+{{% gcr-troubleshooting %}}
+
+## Further reading
+
+{{< partial name="whats-next/whats-next.html" >}}
+
+[1]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/java/
+[2]: /tracing/other_telemetry/connect_logs_and_traces/java/
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/nodejs.md b/content/en/serverless/google_cloud_run/containers/in_process/nodejs.md
new file mode 100644
index 0000000000000..f7b33408215b6
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/nodejs.md
@@ -0,0 +1,82 @@
+---
+title: Instrumenting a Node.js Cloud Run Container In-Process
+code_lang: nodejs
+type: multi-code-lang
+code_lang_weight: 20
+further_reading:
+- link: '/tracing/trace_collection/automatic_instrumentation/dd_libraries/nodejs/'
+ tag: 'Documentation'
+ text: 'Tracing Node.js Applications'
+- link: '/tracing/other_telemetry/connect_logs_and_traces/nodejs/'
+ tag: 'Documentation'
+ text: 'Correlating Node.js Logs and Traces'
+---
+
+## Setup
+1. **Install the Datadog Node.js tracer**.
+
+ 1. In your main application, add `dd-trace-js`.
+
+ {{< code-block lang="shell" disable_copy="false" >}}
+npm install dd-trace --save
+{{< /code-block >}}
+
+ 2. Add the following to your application code to initialize the tracer:
+ {{< code-block lang="javascript" disable_copy="false" >}}
+const tracer = require('dd-trace').init({
+ logInjection: true,
+});
+{{< /code-block >}}
+
+ 3. Set the following environment variable to specify that the `dd-trace/init` module is required when the Node.js process starts:
+ {{< code-block lang="dockerfile" disable_copy="false" >}}
+ENV NODE_OPTIONS="--require dd-trace/init"
+{{< /code-block >}}
+
+ For more information, see [Tracing Node.js applications][1].
+
+2. **Install serverless-init**.
+
+ {{% gcr-install-serverless-init cmd="\"/nodejs/bin/node\", \"/path/to/your/app.js\"" %}}
+
+3. **Set up logs**.
+
+ To enable logging, set the environment variable `DD_LOGS_ENABLED=true`. This allows `serverless-init` to read logs from stdout and stderr.
+
+ Datadog also recommends setting the environment variable `DD_SOURCE=nodejs` to enable advanced Datadog log parsing.
+
+ If you want multiline logs to be preserved in a single log message, Datadog recommends writing your logs in JSON format. For example, you can use a third-party logging library such as `winston`:
+ {{< code-block lang="javascript" disable_copy="false" >}}
+const tracer = require('dd-trace').init({
+ logInjection: true,
+});
+const { createLogger, format, transports } = require('winston');
+
+const logger = createLogger({
+ level: 'info',
+ exitOnError: false,
+ format: format.json(),
+ transports: [
+ new transports.Console()
+ ],
+});
+
+logger.info(`Hello world!`);
+{{< /code-block >}}
+
+ For more information, see [Correlating Node.js Logs and Traces][2].
+
+4. **Configure your application**.
+
+{{% gcr-configure-env-vars language="nodejs" %}}
+
+## Troubleshooting
+
+{{% gcr-troubleshooting %}}
+
+## Further reading
+
+{{< partial name="whats-next/whats-next.html" >}}
+
+[1]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/nodejs/
+[2]: /tracing/other_telemetry/connect_logs_and_traces/nodejs/
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/php.md b/content/en/serverless/google_cloud_run/containers/in_process/php.md
new file mode 100644
index 0000000000000..5a1bbc5e8a58d
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/php.md
@@ -0,0 +1,59 @@
+---
+title: Instrumenting a PHP Cloud Run Container In-Process
+code_lang: php
+type: multi-code-lang
+code_lang_weight: 70
+further_reading:
+ - link: '/tracing/trace_collection/automatic_instrumentation/dd_libraries/php/'
+ tag: 'Documentation'
+ text: 'Tracing PHP Applications'
+ - link: '/tracing/other_telemetry/connect_logs_and_traces/php/'
+ tag: 'Documentation'
+ text: 'Correlating PHP Logs and Traces'
+---
+
+## Setup
+1. **Install the Datadog PHP tracer** in your Dockerfile.
+
+ {{< code-block lang="dockerfile" filename="Dockerfile" disable_copy="false" collapsible="true" >}}
+RUN curl -LO https://github.com/DataDog/dd-trace-php/releases/latest/download/datadog-setup.php \
+ && php datadog-setup.php --php-bin=all
+{{< /code-block >}}
+
+ When running the `datadog-setup.php` script, you can also enable Application Security and Profiling by using the `--enable-appsec` and `--enable-profiling` flags, respectively.
+
+ If you are using Alpine Linux, you need to install `libgcc_s` prior to running the installer:
+
+ {{< code-block lang="shell" disable_copy="false" >}}
+apk add libgcc
+{{< /code-block >}}
+
+ For more information, see [Tracing PHP applications][1].
+
+2. **Install serverless-init**.
+
+ {{% gcr-install-serverless-init cmd="\"apache2-foreground\"" %}}
+
+3. **Set up logs**.
+
+ To enable logging, set the environment variable `DD_LOGS_ENABLED=true`. This allows `serverless-init` to read logs from stdout and stderr.
+
+ Datadog also recommends setting the environment variable `DD_SOURCE=php` to enable advanced Datadog log parsing.
+
+ For more information, see [Correlating PHP Logs and Traces][2].
+
+4. **Configure your application**.
+
+{{% gcr-configure-env-vars language="php" %}}
+
+## Troubleshooting
+
+{{% gcr-troubleshooting %}}
+
+## Further reading
+
+{{< partial name="whats-next/whats-next.html" >}}
+
+[1]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/php/
+[2]: /tracing/other_telemetry/connect_logs_and_traces/php/
+
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/python.md b/content/en/serverless/google_cloud_run/containers/in_process/python.md
new file mode 100644
index 0000000000000..8a10f1fccd598
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/python.md
@@ -0,0 +1,73 @@
+---
+title: Instrumenting a Python Cloud Run Container In-Process
+code_lang: python
+type: multi-code-lang
+code_lang_weight: 10
+further_reading:
+ - link: '/tracing/trace_collection/automatic_instrumentation/dd_libraries/python/'
+ tag: 'Documentation'
+ text: 'Tracing Python Applications'
+ - link: '/tracing/other_telemetry/connect_logs_and_traces/python/'
+ tag: 'Documentation'
+ text: 'Correlating Python Logs and Traces'
+---
+
+## Setup
+1. **Install the Datadog Python tracer** in your Dockerfile.
+
+ {{< code-block lang="dockerfile" filename="Dockerfile" disable_copy="false" collapsible="true" >}}
+RUN pip install --target /dd_tracer/python/ ddtrace
+{{< /code-block >}}
+
+ For more information, see [Tracing Python applications][1].
+
+2. **Install serverless-init**.
+
+ {{% gcr-install-serverless-init cmd="\"/dd_tracer/python/bin/ddtrace-run\", \"python\", \"path/to/your/python/app.py\"" %}}
+
+3. **Set up logs**.
+
+ To enable logging, set the environment variable `DD_LOGS_ENABLED=true`. This allows `serverless-init` to read logs from stdout and stderr.
+
+ Datadog also recommends the following environment variables:
+ - `ENV PYTHONUNBUFFERED=1`: Ensure Python outputs appear immediately in container logs instead of being buffered.
+ - `ENV DD_SOURCE=python`: Enable advanced Datadog log parsing.
+
+ If you want multiline logs to be preserved in a single log message, Datadog recommends writing your logs in JSON format. For example, you can use a third-party logging library such as `structlog`:
+ {{< code-block lang="python" disable_copy="false" >}}
+import structlog
+
+def tracer_injection(logger, log_method, event_dict):
+ event_dict.update(tracer.get_log_correlation_context())
+ return event_dict
+
+structlog.configure(
+ processors=[
+ tracer_injection,
+ structlog.processors.EventRenamer("msg"),
+ structlog.processors.JSONRenderer()
+ ],
+ logger_factory=structlog.WriteLoggerFactory(file=sys.stdout),
+)
+
+logger = structlog.get_logger()
+
+logger.info("Hello world!")
+{{< /code-block >}}
+
+ For more information, see [Correlating Python Logs and Traces][2].
+
+4. **Configure your application**.
+
+{{% gcr-configure-env-vars language="python" %}}
+
+## Troubleshooting
+
+{{% gcr-troubleshooting %}}
+
+## Further reading
+
+{{< partial name="whats-next/whats-next.html" >}}
+
+[1]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/python
+[2]: /tracing/other_telemetry/connect_logs_and_traces/python/
diff --git a/content/en/serverless/google_cloud_run/containers/in_process/ruby.md b/content/en/serverless/google_cloud_run/containers/in_process/ruby.md
new file mode 100644
index 0000000000000..4bf54d5c3f02a
--- /dev/null
+++ b/content/en/serverless/google_cloud_run/containers/in_process/ruby.md
@@ -0,0 +1,61 @@
+---
+title: Instrumenting a Ruby Cloud Run Container In-Process
+code_lang: ruby
+type: multi-code-lang
+code_lang_weight: 60
+further_reading:
+ - link: '/tracing/trace_collection/automatic_instrumentation/dd_libraries/ruby/'
+ tag: 'Documentation'
+ text: 'Tracing Ruby Applications'
+ - link: '/tracing/other_telemetry/connect_logs_and_traces/ruby/'
+ tag: 'Documentation'
+ text: 'Correlating Ruby Logs and Traces'
+---
+
+## Setup
+1. **Install the Datadog Ruby tracer**.
+
+ Add the `datadog` gem to your Gemfile:
+ {{< code-block lang="gemfile" disable_copy="false" >}}
+source 'https://rubygems.org'
+gem 'datadog'
+{{< /code-block >}}
+
+ See [Tracing Ruby applications][1] for additional information on how to configure the tracer and enable auto instrumentation.
+
+2. **Install serverless-init**.
+
+ {{% gcr-install-serverless-init cmd="\"rails\", \"server\", \"-b\", \"0.0.0.0\"" %}}
+
+3. **Set up logs**.
+
+ To enable logging, set the environment variable `DD_LOGS_ENABLED=true`. This allows `serverless-init` to read logs from stdout and stderr.
+
+ Datadog also recommends setting the environment variable `DD_SOURCE=ruby` to enable advanced Datadog log parsing.
+
+ To enable log-trace correlation, you need to include `Datadog::Tracing.log_correlation` in your log format. For example:
+ {{< code-block lang="ruby" disable_copy="false" >}}
+logger = Logger.new(STDOUT)
+logger.formatter = proc do |severity, datetime, progname, msg|
+ "[#{datetime}] #{severity}: [#{Datadog::Tracing.log_correlation}] #{msg}\n"
+end
+
+logger.info "Hello world!"
+{{< /code-block >}}
+
+ For more information, see [Correlating Ruby Logs and Traces][2].
+
+4. **Configure your application**.
+
+{{% gcr-configure-env-vars language="ruby" %}}
+
+## Troubleshooting
+
+{{% gcr-troubleshooting %}}
+
+## Further reading
+
+{{< partial name="whats-next/whats-next.html" >}}
+
+[1]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/ruby/#instrument-your-application
+[2]: /tracing/other_telemetry/connect_logs_and_traces/ruby/
diff --git a/content/en/serverless/google_cloud_run/containers_sidecar.md b/content/en/serverless/google_cloud_run/containers/sidecar/_index.md
similarity index 99%
rename from content/en/serverless/google_cloud_run/containers_sidecar.md
rename to content/en/serverless/google_cloud_run/containers/sidecar/_index.md
index 5b7702bb879bc..785e22af0a617 100644
--- a/content/en/serverless/google_cloud_run/containers_sidecar.md
+++ b/content/en/serverless/google_cloud_run/containers/sidecar/_index.md
@@ -1,5 +1,7 @@
---
-title: Instrumenting Google Cloud Run Containers with Sidecar
+title: Sidecar Instrumentation
+aliases:
+ - /serverless/google_cloud_run/containers_sidecar/
further_reading:
- link: 'https://www.datadoghq.com/blog/instrument-cloud-run-with-datadog-sidecar/'
tag: 'Blog'
@@ -16,7 +18,7 @@ Google Cloud Run is a fully managed serverless platform for deploying and scalin
This page provides instructions for instrumenting your Google Cloud Run containers with the Datadog Agent, which enables tracing, custom metrics, and direct log collection. The Datadog Agent runs in a sidecar container.
-
+
Have you set up your Google Cloud integration? Datadog recommends setting up the integration, which collects metrics and logs from Google Cloud services, before proceeding on to instrumentation. Remember to add the
cloud asset viewer
role to your service account and enable the Cloud Asset Inventory API in Google Cloud.
@@ -873,5 +875,5 @@ $statsd->increment('page.views', 1, array('environment'=>'dev'));
[11]: /tracing/other_telemetry/connect_logs_and_traces/go
[12]: /tracing/other_telemetry/connect_logs_and_traces/ruby
[13]: /getting_started/tagging/unified_service_tagging/
-[14]: /serverless/google_cloud_run/containers_in_process
+[14]: /serverless/google_cloud_run/containers/in_process
[15]: https://cloud.google.com/run/docs/configuring/services/labels
diff --git a/content/en/serverless/google_cloud_run/containers_in_process.md b/content/en/serverless/google_cloud_run/containers_in_process.md
deleted file mode 100644
index 270f3a75960f9..0000000000000
--- a/content/en/serverless/google_cloud_run/containers_in_process.md
+++ /dev/null
@@ -1,195 +0,0 @@
----
-title: Instrumenting Google Cloud Run Containers In-Process
-further_reading:
-
-- link: 'https://www.datadoghq.com/blog/collect-traces-logs-from-cloud-run-with-datadog/'
- tag: 'Blog'
- text: 'Collect traces, logs, and custom metrics from Cloud Run services'
-
----
-
-## Overview
-
-Google Cloud Run is a fully managed serverless platform for deploying and scaling container-based applications.
-
-This page provides instructions for instrumenting your Google Cloud Run containers with the Datadog Agent, which enables tracing, custom metrics, and direct log collection.
-
-
-
-
-
Have you set up your Google Cloud integration? Datadog recommends setting up the integration, which collects metrics and logs from Google Cloud services, before proceeding on to instrumentation. Remember to add the
cloud asset viewer
role to your service account and enable the Cloud Asset Inventory API in Google Cloud.
-
-
-### Prerequisites
-
-Make sure you have a [Datadog API key][7] and are using a programming language [supported by a Datadog tracing library][2].
-
-## Instrument your application
-
-Datadog publishes new releases of the `serverless-init` container image to Google’s gcr.io, AWS’s ECR, and on Docker Hub:
-
-| dockerhub.io | gcr.io | public.ecr.aws |
-| ------------ | ------ | -------------- |
-| datadog/serverless-init | gcr.io/datadoghq/serverless-init | public.ecr.aws/datadog/serverless-init |
-
-Images are tagged based on semantic versioning, with each new version receiving three relevant tags:
-
-* `1`, `1-alpine`: use these to track the latest minor releases, without breaking changes
-* `1.x.x`, `1.x.x-alpine`: use these to pin to a precise version of the library
-* `latest`, `latest-alpine`: use these to follow the latest version release, which may include breaking changes
-
-## How `serverless-init` works
-
-The `serverless-init` application wraps your process and executes it as a subprocess. It starts a DogStatsD listener for metrics and a Trace Agent listener for traces. It collects logs by wrapping the stdout/stderr streams of your application. After bootstrapping, serverless-init then launches your command as a subprocess.
-
-To get full instrumentation, ensure you are calling `datadog-init` as the first command that runs inside your Docker container. You can do this through by setting it as the entrypoint, or by setting it as the first argument in CMD.
-
-{{< programming-lang-wrapper langs="nodejs,python,java,go,dotnet,ruby,php" >}}
-{{< programming-lang lang="nodejs" >}}
-
-{{% svl-init-nodejs %}}
-
-{{< /programming-lang >}}
-{{< programming-lang lang="python" >}}
-
-{{% svl-init-python %}}
-
-{{< /programming-lang >}}
-{{< programming-lang lang="java" >}}
-
-{{% svl-init-java %}}
-
-{{< /programming-lang >}}
-{{< programming-lang lang="go" >}}
-
-{{% svl-init-go %}}
-
-{{< /programming-lang >}}
-{{< programming-lang lang="dotnet" >}}
-
-{{% svl-init-dotnet %}}
-
-{{< /programming-lang >}}
-{{< programming-lang lang="ruby" >}}
-
-{{% svl-init-ruby %}}
-
-{{< /programming-lang >}}
-{{< programming-lang lang="php" >}}
-
-{{% svl-init-php %}}
-
-{{< /programming-lang >}}
-{{< /programming-lang-wrapper >}}
-
-### Buildpack
-
-
Buildpack instrumentation is deprecated.
-
-[`Pack Buildpacks`][3] provide a convenient way to package your container without using a Dockerfile.
-
-First, manually install your tracer:
-- [Node.JS][14]
-- [Python][13]
-- [Java][15]
-- [Go][12]
-- [.NET][18]
-- [Ruby][16]
-- [PHP][17]
-
-Then, build your application by running the following command:
-
-```shell
-pack build --builder=gcr.io/buildpacks/builder \
---buildpack from=builder \
---buildpack datadog/serverless-buildpack:latest \
-gcr.io/
/
-```
-
-**Note**: Buildpack instrumentation is not compatible with Alpine images.
-
-## Configure your application
-
-After the container is built and pushed to your registry, set the required environment variables for the Datadog Agent:
-- `DD_API_KEY`: Datadog API key, used to send data to your Datadog account. It should be configured as a [Google Cloud Secret][11] for privacy and safety.
-- `DD_SITE`: Datadog endpoint and website. Select your site on the right side of this page. Your site is: {{< region-param key="dd_site" code="true" >}}.
-
-For more environment variables and their function, see [Environment Variables](#environment-variables).
-
-The following command deploys the service and allows any external connection to reach it. In this example, your service listening is set to port 8080. Ensure that this port number matches the exposed port inside of your Dockerfile.
-
-```
-shell
-gcloud run deploy --image=gcr.io// \
- --port=8080 \
- --update-env-vars=DD_API_KEY=$DD_API_KEY \
- --update-env-vars=DD_SITE=$DD_SITE \
-```
-
-See [all arguments and flags for `gcloud run deploy`][26].
-
-## Results
-
-After the deployment is completed, your metrics and traces are sent to Datadog. In Datadog, navigate to **Infrastructure > Serverless** to see your serverless metrics and traces.
-
-## Additional configurations
-
-- **Advanced tracing:** The Datadog Agent already provides some basic tracing for popular frameworks. Follow the [advanced tracing guide][2] for more information.
-
-- **Logs:** If you use the [Google Cloud integration][1], your logs are already being collected. Alternatively, you can set the `DD_LOGS_ENABLED` environment variable to `true` to capture application logs through the serverless instrumentation directly.
-
-- **Custom metrics:** You can submit custom metrics using a [DogStatsD client][4]. For monitoring Cloud Run and other serverless applications, use [distribution][9] metrics. Distributions provide `avg`, `sum`, `max`, `min`, and `count` aggregations by default. On the Metric Summary page, you can enable percentile aggregations (p50, p75, p90, p95, p99) and also manage tags. To monitor a distribution for a gauge metric type, use `avg` for both the [time and space aggregations][11]. To monitor a distribution for a count metric type, use `sum` for both the time and space aggregations.
-
-### Environment variables
-
-| Variable | Description |
-| -------- | ----------- |
-|`DD_API_KEY`| [Datadog API key][7] - **Required**|
-| `DD_SITE` | [Datadog site][5] - **Required** |
-| `DD_LOGS_ENABLED` | When true, send logs (stdout and stderr) to Datadog. Defaults to false. |
-| `DD_LOGS_INJECTION`| When true, enrich all logs with trace data for supported loggers in [Java][19], [Node][20], [.NET][21], and [PHP][22]. See additional docs for [Python][23], [Go][24], and [Ruby][25]. |
-| `DD_SERVICE` | See [Unified Service Tagging][6]. |
-| `DD_VERSION` | See [Unified Service Tagging][6]. |
-| `DD_ENV` | See [Unified Service Tagging][6]. |
-| `DD_SOURCE` | See [Unified Service Tagging][6]. |
-| `DD_TAGS` | See [Unified Service Tagging][6]. |
-
-## Troubleshooting
-
-This integration depends on your runtime having a full SSL implementation. If you are using a slim image, you may need to add the following command to your Dockerfile to include certificates.
-
-```
-RUN apt-get update && apt-get install -y ca-certificates
-```
-
-## Further reading
-
-{{< partial name="whats-next/whats-next.html" >}}
-
-
-[1]: /integrations/google_cloud_platform/#log-collection
-[2]: /tracing/trace_collection/#for-setup-instructions-select-your-language
-[3]: https://buildpacks.io/docs/tools/pack/
-[4]: /metrics/custom_metrics/dogstatsd_metrics_submission/
-[5]: /getting_started/site/
-[6]: /getting_started/tagging/unified_service_tagging/
-[7]: /account_management/api-app-keys/#api-keys
-[8]: https://github.com/DataDog/crpb/tree/main
-[9]: /metrics/distributions/
-[10]: /metrics/#time-and-space-aggregation
-[11]: https://cloud.google.com/run/docs/configuring/secrets
-[12]: /tracing/trace_collection/library_config/go/
-[13]: /tracing/trace_collection/dd_libraries/python/?tab=containers#instrument-your-application
-[14]: /tracing/trace_collection/dd_libraries/nodejs/?tab=containers#instrument-your-application
-[15]: /tracing/trace_collection/dd_libraries/java/?tab=containers#instrument-your-application
-[16]: /tracing/trace_collection/dd_libraries/ruby/?tab=containers#instrument-your-application
-[17]: /tracing/trace_collection/dd_libraries/php/?tab=containers#install-the-extension
-[18]: /tracing/trace_collection/dd_libraries/dotnet-core/?tab=linux#custom-instrumentation
-[19]: /tracing/other_telemetry/connect_logs_and_traces/java/?tab=log4j2
-[20]: /tracing/other_telemetry/connect_logs_and_traces/nodejs
-[21]: /tracing/other_telemetry/connect_logs_and_traces/dotnet?tab=serilog
-[22]: /tracing/other_telemetry/connect_logs_and_traces/php
-[23]: /tracing/other_telemetry/connect_logs_and_traces/python
-[24]: /tracing/other_telemetry/connect_logs_and_traces/go
-[25]: /tracing/other_telemetry/connect_logs_and_traces/ruby
-[26]: https://cloud.google.com/sdk/gcloud/reference/run/deploy
diff --git a/layouts/partials/serverless/in-process-languages.html b/layouts/partials/serverless/in-process-languages.html
new file mode 100644
index 0000000000000..2d717c0a92c2a
--- /dev/null
+++ b/layouts/partials/serverless/in-process-languages.html
@@ -0,0 +1,58 @@
+{{ $dot := . }}
+
+
diff --git a/layouts/shortcodes/gcr-configure-env-vars.en.html b/layouts/shortcodes/gcr-configure-env-vars.en.html
new file mode 100644
index 0000000000000..0473983767dfb
--- /dev/null
+++ b/layouts/shortcodes/gcr-configure-env-vars.en.html
@@ -0,0 +1,36 @@
+ After the container is built and pushed to your registry, set the required environment variables for the Datadog Agent:
+
+ - `DD_API_KEY`: Your [Datadog API key][1001], used to send data to your Datadog account. For privacy and safety, configure this API key as a Google Cloud Secret.
+ - `DD_SITE`: Your [Datadog site][1002]. For example, `datadoghq.com`.
+
+ For more environment variables, see the [Environment variables](#environment-variables) section on this page.
+
+ The following command deploys the service and allows any external connection to reach it. In this example, your service listening is set to port 8080. Ensure that this port number matches the exposed port inside of your Dockerfile.
+
+ ```shell
+ gcloud run deploy
+ --image=gcr.io// \
+ --port=8080 \
+ --update-env-vars=DD_API_KEY=$DD_API_KEY \
+ --update-env-vars=DD_SITE=$DD_SITE \
+ ```
+
+### Environment variables
+
+| Variable | Description |
+| ------------------- | ----------- |
+| `DD_API_KEY` | [Datadog API key][1001] - **Required**|
+| `DD_SITE` | [Datadog site][1002] - **Required** |
+| `DD_LOGS_ENABLED` | When true, send logs (stdout and stderr) to Datadog. Defaults to false. |{{ if in (slice "java" "nodejs" "csharp" "php") (.Get "language") }}
+| `DD_LOGS_INJECTION` | When true, enrich all logs with trace data for supported loggers. See [Correlate Logs and Traces][1003] for more information. |{{ end }}
+| `DD_SERVICE` | See [Unified Service Tagging][1004]. **Recommended** |
+| `DD_VERSION` | See [Unified Service Tagging][1004]. **Recommended** |
+| `DD_ENV` | See [Unified Service Tagging][1004]. **Recommended** |
+| `DD_SOURCE` | Set the log source to enable a [Log Pipeline][1005] for advanced parsing. To automatically apply language-specific parsing rules, set to `{{ .Get "language" }}`, or use your custom pipeline. Defaults to `cloudrun`. |
+| `DD_TAGS` | Add custom tags to your logs, metrics, and traces. Tags should be comma separated in key/value format (for example: `key1:value1,key2:value2`). |
+
+[1001]: https://app.datadoghq.com/organization-settings/api-keys
+[1002]: /getting_started/site/
+[1003]: /tracing/other_telemetry/connect_logs_and_traces/
+[1004]: /getting_started/tagging/unified_service_tagging/
+[1005]: /logs/log_configuration/pipelines
\ No newline at end of file
diff --git a/layouts/shortcodes/gcr-install-serverless-init.html b/layouts/shortcodes/gcr-install-serverless-init.html
new file mode 100644
index 0000000000000..de4dbba31f29d
--- /dev/null
+++ b/layouts/shortcodes/gcr-install-serverless-init.html
@@ -0,0 +1,56 @@
+Datadog publishes new releases of the `serverless-init` container image to Google's gcr.io, AWS's ECR, and on Docker Hub:
+
+| hub.docker.com | gcr.io | public.ecr.aws |
+| ---- | ---- | ---- |
+| datadog/serverless-init | gcr.io/datadoghq/serverless-init | public.ecr.aws/datadog/serverless-init |
+
+Images are tagged based on semantic versioning, with each new version receiving three relevant tags:
+
+- `1`, `1-alpine`: use these to track the latest minor releases, without breaking changes
+- `1.x.x`, `1.x.x-alpine`: use these to pin to a precise version of the library
+- `latest`, `latest-alpine`: use these to follow the latest version release, which may include breaking changes
+
+Add the following instructions and arguments to your Dockerfile.
+
+```dockerfile
+COPY --from=datadog/serverless-init:1 /datadog-init /app/datadog-init
+ENTRYPOINT ["/app/datadog-init"]
+CMD [{{ .Get "cmd" | safeHTML }}]
+```
+
+
+
+
+
+
+Datadog expects `serverless-init` to be the top-level application, with the rest of your app's command line passed in for `serverless-init` to execute.
+
+If you already have an entrypoint defined inside your Dockerfile, you can instead modify the CMD argument.
+
+```dockerfile
+CMD ["/app/datadog-init", {{ .Get "cmd" | safeHTML }}]
+```
+
+If you require your entrypoint to be instrumented as well, you can instead swap your entrypoint and CMD arguments.
+
+```dockerfile
+ENTRYPOINT ["/app/datadog-init"]
+CMD ["/your_entrypoint.sh", {{ .Get "cmd" | safeHTML }}]
+```
+
+As long as your command to run is passed as an argument to `datadog-init`, you will receive full instrumentation.
+
+
+
+
diff --git a/layouts/shortcodes/gcr-troubleshooting.en.md b/layouts/shortcodes/gcr-troubleshooting.en.md
new file mode 100644
index 0000000000000..323c73517342b
--- /dev/null
+++ b/layouts/shortcodes/gcr-troubleshooting.en.md
@@ -0,0 +1,9 @@
+This integration depends on your runtime having a full SSL implementation. If you are using a slim image, you may need to add the following command to your Dockerfile to include certificates:
+
+```dockerfile
+RUN apt-get update && apt-get install -y ca-certificates
+```
+
+To have your Cloud Run services appear in the [software catalog][2001], you must set the `DD_SERVICE`, `DD_VERSION`, and `DD_ENV` environment variables.
+
+[2001]: /internal_developer_portal/software_catalog/
\ No newline at end of file
diff --git a/layouts/shortcodes/google-cloud-run-container-options.html b/layouts/shortcodes/google-cloud-run-container-options.html
index e78d49c229ed2..7fb999d5228ad 100644
--- a/layouts/shortcodes/google-cloud-run-container-options.html
+++ b/layouts/shortcodes/google-cloud-run-container-options.html
@@ -1,21 +1,21 @@