Skip to content

Commit 8bda8a2

Browse files
nhulstonbrett0000FF
authored andcommitted
[Cloud Run] Add service label instructions to sidecar docs & other nits (#31266)
* Add `DD_SERVERLESS_LOG_PATH` to sidecar docs * Add better practice python tracer installation * (chore): extract service label step into it's own shortcode * add service label to sidecar docs
1 parent 790f718 commit 8bda8a2

File tree

17 files changed

+89
-45
lines changed

17 files changed

+89
-45
lines changed

content/en/serverless/google_cloud_run/containers/in_process/dotnet.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ logger.LogInformation("Hello World!");
7070

7171
{{% gcr-configure %}}
7272

73+
5. {{% gcr-service-label %}}
74+
7375
6. **Send custom metrics**.
7476

7577
To send custom metrics, [install the DogStatsD client][4] and [view code examples][5].

content/en/serverless/google_cloud_run/containers/in_process/go.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ go get github.com/DataDog/dd-trace-go/contrib/net/http/v2
6565

6666
{{% gcr-configure%}}
6767

68+
5. {{% gcr-service-label %}}
69+
6870
6. **Send custom metrics**.
6971

7072
To send custom metrics, [install the DogStatsD client][4] and [view code examples][5].

content/en/serverless/google_cloud_run/containers/in_process/java.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ logger.info("Hello World!");
8080

8181
{{% gcr-configure%}}
8282

83+
5. {{% gcr-service-label %}}
84+
8385
6. **Send custom metrics**.
8486

8587
To send custom metrics, [install the DogStatsD client][3] and [view code examples][4].

content/en/serverless/google_cloud_run/containers/in_process/nodejs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ logger.info(`Hello world!`);
7373

7474
{{% gcr-configure %}}
7575

76+
5. {{% gcr-service-label %}}
77+
7678
6. **Send custom metrics**.
7779

7880
To send custom metrics, [view code examples][3].

content/en/serverless/google_cloud_run/containers/in_process/php.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ apk add libgcc
4949

5050
{{% gcr-configure %}}
5151

52+
5. {{% gcr-service-label %}}
53+
5254
6. **Send custom metrics**.
5355

5456
To send custom metrics, [install the DogStatsD client][3] and [view code examples][4].

content/en/serverless/google_cloud_run/containers/in_process/python.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,23 @@ further_reading:
1616

1717
<div class="alert alert-info">A sample application is <a href="https://github.com/DataDog/serverless-gcp-sample-apps/tree/main/cloud-run/in-process/python">available on GitHub</a>.</div>
1818

19-
1. **Install the Datadog Python tracer** in your Dockerfile.
19+
1. **Install the Datadog Python tracer**.
2020

21+
Add `ddtrace` to your `requirements.txt` or `pyproject.toml`. You can find the latest version on [PyPI][1]:
22+
{{< code-block lang="text" filename="requirements.txt" disable_copy="false" collapsible="true" >}}
23+
ddtrace==<VERSION>
24+
{{< /code-block >}}
25+
26+
Alternatively, you can install the tracer in your Dockerfile:
2127
{{< code-block lang="dockerfile" filename="Dockerfile" disable_copy="false" collapsible="true" >}}
22-
RUN pip install --target /dd_tracer/python/ ddtrace
28+
RUN pip install ddtrace
2329
{{< /code-block >}}
2430

25-
For more information, see [Tracing Python applications][1].
31+
For more information, see [Tracing Python applications][2].
2632

2733
2. **Install serverless-init**.
2834

29-
{{% gcr-install-serverless-init cmd="\"/dd_tracer/python/bin/ddtrace-run\", \"python\", \"path/to/your/python/app.py\"" %}}
35+
{{% gcr-install-serverless-init cmd="\"ddtrace-run\", \"python\", \"path/to/your/python/app.py\"" %}}
3036

3137
3. **Set up logs**.
3238

@@ -58,15 +64,17 @@ logger = structlog.get_logger()
5864
logger.info("Hello world!")
5965
{{< /code-block >}}
6066

61-
For more information, see [Correlating Python Logs and Traces][2].
67+
For more information, see [Correlating Python Logs and Traces][3].
6268

6369
4. **Configure your application**.
6470

6571
{{% gcr-configure %}}
6672

73+
5. {{% gcr-service-label %}}
74+
6775
6. **Send custom metrics**.
6876

69-
To send custom metrics, [install the DogStatsD client][3] and [view code examples][4].
77+
To send custom metrics, [install the DogStatsD client][4] and [view code examples][5].
7078

7179
{{% gcr-env-vars instrumentationMethod="in-process" language="python" %}}
7280

@@ -78,7 +86,8 @@ logger.info("Hello world!")
7886

7987
{{< partial name="whats-next/whats-next.html" >}}
8088

81-
[1]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/python
82-
[2]: /tracing/other_telemetry/connect_logs_and_traces/python/
83-
[3]: /developers/dogstatsd/?tab=python#install-the-dogstatsd-client
84-
[4]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=python#code-examples
89+
[1]: https://pypi.org/project/ddtrace/
90+
[2]: /tracing/trace_collection/automatic_instrumentation/dd_libraries/python
91+
[3]: /tracing/other_telemetry/connect_logs_and_traces/python/
92+
[4]: /developers/dogstatsd/?tab=python#install-the-dogstatsd-client
93+
[5]: /metrics/custom_metrics/dogstatsd_metrics_submission/?tab=python#code-examples

content/en/serverless/google_cloud_run/containers/in_process/ruby.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ logger.info "Hello world!"
5252

5353
{{% gcr-configure %}}
5454

55+
5. {{% gcr-service-label %}}
56+
5557
6. **Send custom metrics**.
5658

5759
To send custom metrics, [install the DogStatsD client][3] and [view code examples][4].

content/en/serverless/google_cloud_run/containers/sidecar/dotnet.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ logger.LogInformation("Hello World!");
8585

8686
For more information, see [Correlating .NET Logs and Traces][3].
8787

88-
4. **Send custom metrics**.
88+
4. {{% gcr-service-label %}}
89+
90+
5. **Send custom metrics**.
8991

9092
To send custom metrics, [install the DogStatsD client][4] and [view code examples][5].
9193

content/en/serverless/google_cloud_run/containers/sidecar/go.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ logrus.WithContext(ctx).Info("Hello World!")
8282

8383
For more information, see [Correlating Go Logs and Traces][3].
8484

85-
4. **Send custom metrics**.
85+
4. {{% gcr-service-label %}}
86+
87+
5. **Send custom metrics**.
8688

8789
To send custom metrics, [install the DogStatsD client][4] and [view code examples][5].
8890

content/en/serverless/google_cloud_run/containers/sidecar/java.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ logger.info("Hello World!");
9393

9494
For more information, see [Correlating Java Logs and Traces][2].
9595

96-
4. **Send custom metrics**.
96+
4. {{% gcr-service-label %}}
97+
98+
5. **Send custom metrics**.
9799

98100
To send custom metrics, [install the DogStatsD client][3] and [view code examples][4].
99101

0 commit comments

Comments
 (0)