mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-01 16:04:19 +00:00
Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
@ -6,14 +6,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
||||
|
||||
# Tutorial: Use GitLab Observability with a Django application
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
FLAG:
|
||||
The availability of this feature is controlled by a feature flag.
|
||||
For more information, see the history of the [**Distributed tracing** feature](../../operations/tracing.md).
|
||||
<!-- Update this note when observability_features flag is removed -->
|
||||
|
||||
In this tutorial, we'll show you how to create, configure, instrument, and monitor a Django application using GitLab observability features.
|
||||
|
||||
@ -23,7 +19,7 @@ In this tutorial, we'll show you how to create, configure, instrument, and monit
|
||||
|
||||
To follow along this tutorial, you should have:
|
||||
|
||||
- A GitLab Ultimate subscription for GitLab.com
|
||||
- A GitLab Ultimate subscription for GitLab.com or GitLab self-managed
|
||||
- A local installation of Python 3 and Django (You can install it with `python -m pip install Django`.)
|
||||
- Basic knowledge of Git and Python
|
||||
- Basic knowledge of the core concepts of [OpenTelemetry](https://opentelemetry.io/)
|
||||
@ -39,7 +35,7 @@ This tutorial uses the project name `animals`.
|
||||
- In the **Project name** field, enter `animals`.
|
||||
1. Select **Create project**.
|
||||
1. In the `animals` project, on the left sidebar, select **Settings > Access tokens**.
|
||||
1. Create an access token with the Owner role and the `read_api` and `write_observability` scopes. Store the token value somewhere safe—you'll need it later.
|
||||
1. Create an access token with the `api` scope and Developer role. Store the token value somewhere safe—you'll need it later.
|
||||
|
||||
## Create a Django application
|
||||
|
||||
@ -147,7 +143,9 @@ To create an application:
|
||||
from opentelemetry.sdk.metrics.export import PeriodicExportingMetricReader, ConsoleMetricExporter
|
||||
```
|
||||
|
||||
1. To instrument the application, in the `manage.py` file add the following code (replacing `{{PROJECT_ACCESS_TOKEN}}`, `{{NAMESPACE_ID}}`, and `{{PROJECT_ID}}` with the values from your project and root namespace):
|
||||
1. To instrument the application, in the `manage.py` file, add the following code.
|
||||
- Replace `{{PROJECT_ACCESS_TOKEN}}` and `{{PROJECT_ID}}` with the values from your project.
|
||||
- If you're using self-managed GitLab, replace `gitlab.com` with your self-managed instance hostname.
|
||||
|
||||
```python
|
||||
resource = Resource(attributes={
|
||||
@ -155,12 +153,12 @@ To create an application:
|
||||
})
|
||||
os.environ.setdefault('OTEL_EXPORTER_OTLP_HEADERS', "PRIVATE-TOKEN={{PROJECT_ACCESS_TOKEN}}")
|
||||
traceProvider = TracerProvider(resource=resource)
|
||||
processor = BatchSpanProcessor(OTLPSpanExporter(endpoint="https://observe.gitlab.com/v3/{{NAMESPACE_ID}}/{{PROJECT_ID}}/ingest/traces"))
|
||||
processor = BatchSpanProcessor(OTLPSpanExporter(endpoint="https://gitlab.com/api/v4/projects/{{PROJECT_ID}}/observability/v1/traces"))
|
||||
traceProvider.add_span_processor(processor)
|
||||
trace.set_tracer_provider(traceProvider)
|
||||
|
||||
reader = PeriodicExportingMetricReader(
|
||||
OTLPMetricExporter(endpoint="https://observe.gitlab.com/v3/{{NAMESPACE_ID}}/{{PROEJCT_ID}}/ingest/metrics")
|
||||
OTLPMetricExporter(endpoint="https://gitlab.com/api/v4/projects/{{PROJECT_ID}}/observability/v1/metrics")
|
||||
)
|
||||
meterProvider = MeterProvider(resource=resource, metric_readers=[reader])
|
||||
metrics.set_meter_provider(meterProvider)
|
||||
|
@ -6,17 +6,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
||||
|
||||
# Tutorial: Use GitLab Observability with a .NET application
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
> - Observability [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124966) in GitLab 16.2 [with a flag](../../administration/feature_flags.md) named `observability_features`. Disabled by default.
|
||||
|
||||
FLAG:
|
||||
The availability of this feature is controlled by a feature flag.
|
||||
For more information, see the history.
|
||||
This feature is available for testing, but not ready for production use.
|
||||
For more information, see the history of the [**Distributed tracing** feature](../../operations/tracing.md).
|
||||
<!-- Update this note when observability_features flag is removed -->
|
||||
|
||||
In this tutorial, you'll learn how to create, configure, instrument, and monitor a .NET Core application using GitLab Observability features.
|
||||
|
||||
@ -24,7 +17,7 @@ In this tutorial, you'll learn how to create, configure, instrument, and monitor
|
||||
|
||||
To follow along this tutorial, you must have:
|
||||
|
||||
- A GitLab Ultimate subscription for GitLab.com
|
||||
- A GitLab Ultimate subscription for GitLab.com or GitLab self-managed
|
||||
- A local installation of [.NET](https://dotnet.microsoft.com/en-us/)
|
||||
- Basic knowledge of Git, .NET, and the core concepts of [OpenTelemetry](https://opentelemetry.io/)
|
||||
|
||||
@ -38,7 +31,8 @@ First, create a GitLab project and a corresponding access token.
|
||||
- In the **Project name** field, enter `dotnet-O11y-tutorial`.
|
||||
1. Select **Create project**.
|
||||
1. In the `dotnet-O11y-tutorial` project, on the left sidebar, select **Settings > Access tokens**.
|
||||
1. Create a new access token with the Owner role and the `read_api` and `write_observability` scopes. Store the token value somewhere safe—you'll need it later.
|
||||
1. Create an access token with the `api` scope and Developer role. Store the token value somewhere safe.
|
||||
You'll need it later.
|
||||
|
||||
## Create a .NET application
|
||||
|
||||
@ -205,18 +199,16 @@ Next, we'll create a .NET web application that we can instrument. For this tutor
|
||||
app.Run();
|
||||
```
|
||||
|
||||
1. Find your group ID:
|
||||
1. On the left sidebar, select **Search or go to** and find the top-level group with the `dotnet-O11y-tutorial` project. For example, if your project URL is `https://gitlab.com/tankui/observability/dotnet-O11y-tutorial`, the top-level group is `tanuki`.
|
||||
1. On the group overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
|
||||
1. Select **Copy group ID**. Save the copied ID for later.
|
||||
1. Find your project ID:
|
||||
1. On the `dotnet-O11y-tutorial` project overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
|
||||
1. Select **Copy project ID**. Save the copied ID for later.
|
||||
|
||||
1. Configure and run your application with instrumentation:
|
||||
1. Configure your application with instrumentation.
|
||||
If you're using self-managed GitLab, replace `gitlab.com` with your self-managed instance hostname.
|
||||
1. Run your application.
|
||||
|
||||
```shell
|
||||
env OTEL_EXPORTER_OTLP_ENDPOINT="https://observe.gitlab.com/v3/{{GROUP_ID}}/{{PROJECT_ID}}/ingest" \
|
||||
env OTEL_EXPORTER_OTLP_ENDPOINT="https://gitlab.com/api/v4/projects/{{PROJECT_ID}}/observability" \
|
||||
OTEL_EXPORTER_OTLP_HEADERS="PRIVATE-TOKEN={{ACCESS_TOKEN}}" \
|
||||
OTEL_LOG_LEVEL="debug" \
|
||||
dotnet run
|
||||
|
@ -6,17 +6,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
||||
|
||||
# Tutorial: Use GitLab Observability with a Java Spring application
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
> - Observability [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124966) in GitLab 16.2 [with a flag](../../administration/feature_flags.md) named `observability_features`. Disabled by default.
|
||||
|
||||
FLAG:
|
||||
The availability of this feature is controlled by a feature flag.
|
||||
For more information, see the history.
|
||||
This feature is available for testing, but not ready for production use.
|
||||
For more information, see the history of the [**Distributed tracing** feature](../../operations/tracing.md).
|
||||
<!-- Update this note when observability_features flag is removed -->
|
||||
|
||||
In this tutorial, you'll learn how to create, configure, instrument, and monitor a Java Spring application using GitLab Observability features.
|
||||
|
||||
@ -24,7 +15,7 @@ In this tutorial, you'll learn how to create, configure, instrument, and monitor
|
||||
|
||||
To follow along this tutorial, you must have:
|
||||
|
||||
- A GitLab Ultimate subscription for GitLab.com
|
||||
- A GitLab Ultimate subscription for GitLab.com or GitLab self-managed
|
||||
- A local installation of Ruby on Rails
|
||||
- Basic knowledge of Git, Java Spring, and the core concepts of [OpenTelemetry](https://opentelemetry.io/)
|
||||
|
||||
@ -39,7 +30,8 @@ First, create a GitLab project and a corresponding access token.
|
||||
- In the **Project name** field, enter a name such as `test-spring-o11y`
|
||||
1. Select **Create project**.
|
||||
1. In the `test-sprint-o11y` project, on the left sidebar, select **Settings > Access tokens**.
|
||||
1. Create a new access token with the Owner role and the `read_api` and `write_observability` scopes. Store the token value somewhere safe—you'll need it later.
|
||||
1. Create an access token with the `api` scope and Developer role. Store the token value somewhere safe.
|
||||
You'll need it later.
|
||||
|
||||
## Run the application
|
||||
|
||||
@ -107,15 +99,13 @@ The OpenTelemetry autoconfigure libraries read their configuration from environm
|
||||
|
||||

|
||||
|
||||
1. Add the following set of environment variables, replacing `{{PATH_TO_JAVA_AGENT}}`, `{{NAMESPACE_ID}}`, `{{PROJECT_ID}}`, `{{PROJECT_ACCESS_TOKEN}}` and `{{SERVICE_NAME}}` with the correct values.
|
||||
1. Add the following set of environment variables, replacing `{{PATH_TO_JAVA_AGENT}}`, `{{PROJECT_ID}}`, `{{PROJECT_ACCESS_TOKEN}}` and `{{SERVICE_NAME}}` with the correct values. If using a self-managed GitLab instance, replace `gitlab.com` with your self-managed instance hostname.
|
||||
- `JAVA_TOOL_OPTIONS=-javaagent:{{PATH_TO_JAVA_AGENT}}/opentelemetry-javaagent.jar`
|
||||
- `OTEL_EXPORTER_OTLP_ENDPOINT=https://observe.gitlab.com/v3/{{NAMESPACE_ID}}/{{PROJECT_ID}}/ingest`
|
||||
- `OTEL_EXPORTER_OTLP_ENDPOINT=https://gitlab.com/api/v4/projects/{{PROJECT_ID}}/observability`
|
||||
- `OTEL_EXPORTER_OTLP_HEADERS=PRIVATE-TOKEN\={{PROJECT_ACCESS_TOKEN}}`
|
||||
- `OTEL_LOGS_EXPORTER=otlp`
|
||||
- `OTEL_EXPORTER=otlphttp`
|
||||
- `OTEL_METRIC_EXPORT_INTERVAL=15000`
|
||||
- `OTEL_METRICS_EXPORTER=otlp`
|
||||
- `OTEL_SERVICE_NAME=example-java-application`
|
||||
- `OTEL_TRACES_EXPORTER=otlp`
|
||||
|
||||
1. Restart the application and reload the page at `http://localhost:8000` a few times.
|
||||
|
||||
|
@ -6,14 +6,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
||||
|
||||
# Tutorial: Use GitLab Observability with a NodeJS application
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
FLAG:
|
||||
The availability of this feature is controlled by a feature flag.
|
||||
For more information, see the history of the [**Distributed tracing** feature](../../operations/tracing.md).
|
||||
<!-- Update this note when observability_features flag is removed -->
|
||||
|
||||
In this tutorial, you'll learn how to configure, instrument, and monitor a NodeJS application using GitLab Observability features.
|
||||
|
||||
@ -21,7 +17,7 @@ In this tutorial, you'll learn how to configure, instrument, and monitor a NodeJ
|
||||
|
||||
Take a moment and make sure you have the following:
|
||||
|
||||
- A GitLab Ultimate subscription for GitLab.com
|
||||
- A GitLab Ultimate subscription for GitLab.com or GitLab self-managed
|
||||
- A local installation of NodeJS
|
||||
- Basic knowledge of Git, NodeJS, JavaScript, and the core concepts of [OpenTelemetry](https://opentelemetry.io/)
|
||||
|
||||
@ -37,7 +33,7 @@ This tutorial uses the project name `nodejs-O11y-tutorial`.
|
||||
- In the **Project name** field, enter `nodejs-O11y-tutorial`.
|
||||
1. Select **Create project**.
|
||||
1. In the `nodejs-O11y-tutorial` project, on the left sidebar, select **Settings > Access tokens**.
|
||||
1. Create a new access token with the Owner role and the `read_api` and `write_observability` scopes. Store the token value somewhere safe—you'll need it later.
|
||||
1. Create an access token with the `api` scope and Developer role. Store the token value somewhere safe—you'll need it later.
|
||||
|
||||
## Instrument your NodeJS application
|
||||
|
||||
@ -70,10 +66,6 @@ Next, we need to instrument the NodeJS application.
|
||||
@opentelemetry/auto-instrumentations-node
|
||||
```
|
||||
|
||||
1. Find your group ID:
|
||||
1. On the left sidebar, select **Search or go to** and find the top-level group with the `nodejs-O11y-tutorial` project. For example, if your project URL is `https://gitlab.com/tankui/observability/nodejs-O11y-tutorial`, the top-level group is `tanuki`.
|
||||
1. On the group overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
|
||||
1. Select **Copy group ID**. Save the copied ID for later.
|
||||
1. Find your project ID:
|
||||
1. On the `nodejs-O11y-tutorial` project overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
|
||||
1. Select **Copy project ID**. Save the copied ID for later.
|
||||
@ -81,8 +73,8 @@ Next, we need to instrument the NodeJS application.
|
||||
1. Configure and run your project with instrumentation:
|
||||
|
||||
```shell
|
||||
env OTEL_TRACES_EXPORTER="otlp" \
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT="https://observe.gitlab.com/v3/{{GROUP_ID}}/{{PROJECT_ID}}/ingest" \
|
||||
env OTEL_TRACES_EXPORTER="otlphttp" \
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT="https://gitlab.com/api/v4/projects/{{PROJECT_ID}}/observability" \
|
||||
OTEL_EXPORTER_OTLP_HEADERS="PRIVATE-TOKEN={{ACCESS_TOKEN}}" \
|
||||
OTEL_SERVICE_NAME="nodejs-O11y-tutorial" \
|
||||
OTEL_LOG_LEVEL="debug" \
|
||||
@ -90,7 +82,8 @@ Next, we need to instrument the NodeJS application.
|
||||
PORT=8080 node server.js
|
||||
```
|
||||
|
||||
Be sure to replace the `GROUP_ID`, `PROJECT_ID`, and `ACCESS_TOKEN` with the values you obtained earlier.
|
||||
Be sure to replace the `PROJECT_ID`, and `ACCESS_TOKEN` with the values you obtained earlier.
|
||||
If using a self-managed GitLab instance, replace `gitlab.com` with your self-managed instance hostname.
|
||||
|
||||
## View traces
|
||||
|
||||
|
@ -6,14 +6,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
||||
|
||||
# Tutorial: Use GitLab Observability with a Ruby on Rails application
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Ultimate
|
||||
**Offering:** GitLab.com
|
||||
**Status:** Beta
|
||||
|
||||
FLAG:
|
||||
The availability of this feature is controlled by a feature flag.
|
||||
For more information, see the history of the [**Distributed tracing** feature](../../operations/tracing.md).
|
||||
<!-- Update this note when observability_features flag is removed -->
|
||||
|
||||
In this tutorial, you'll learn how to create, configure, instrument, and monitor a Ruby on Rails application using GitLab Observability features.
|
||||
|
||||
@ -21,7 +17,7 @@ In this tutorial, you'll learn how to create, configure, instrument, and monitor
|
||||
|
||||
Take a moment and make sure you have the following:
|
||||
|
||||
- A GitLab Ultimate subscription for GitLab.com
|
||||
- A GitLab Ultimate subscription for GitLab.com or GitLab self-managed
|
||||
- A local installation of Ruby on Rails
|
||||
- Basic knowledge of Git, Ruby on Rails, and the core concepts of [OpenTelemetry](https://opentelemetry.io/)
|
||||
|
||||
@ -36,7 +32,7 @@ This tutorial uses the project name `animals`.
|
||||
- In the **Project name** field, enter `animals`.
|
||||
1. Select **Create project**.
|
||||
1. In the `animals` project, on the left sidebar, select **Settings > Access tokens**.
|
||||
1. Create a new access token with the Owner role and the `read_api` and `write_observability` scopes. Store the token value somewhere safe—you'll need it later.
|
||||
1. Create an access token with the `api` scope and Developer role. Store the token value somewhere safe—you'll need it later.
|
||||
|
||||
## Create a Rails application
|
||||
|
||||
@ -92,10 +88,6 @@ To create an application:
|
||||
end
|
||||
```
|
||||
|
||||
1. Find your group ID:
|
||||
1. On the left sidebar, select **Search or go to** and find the top-level group with the `animal` project. For example, if your project URL is `https://gitlab.com/tankui/observability/animal`, the top-level group is `tanuki`.
|
||||
1. On the group overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
|
||||
1. Select **Copy group ID**. Save the copied ID for later.
|
||||
1. Find your project ID:
|
||||
1. On the `animal` project overview page, in the upper-right corner, select **Actions** (**{ellipsis_v}**).
|
||||
1. Select **Copy project ID**. Save the copied ID for later.
|
||||
@ -104,12 +96,13 @@ To create an application:
|
||||
|
||||
```shell
|
||||
OTEL_EXPORTER = "otlphttp"
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT = "https://observe.gitlab.com/v3/{{GROUP_ID}}/{{PROJECT_ID}}/ingest"
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT = "https://gitlab.com/api/v4/projects/{{PROJECT_ID}}/observability"
|
||||
OTEL_EXPORTER_OTLP_HEADERS = "PRIVATE-TOKEN={{ACCESS_TOKEN}}"
|
||||
OTEL_LOG_LEVEL = "debug"
|
||||
```
|
||||
|
||||
Be sure to replace the `GROUP_ID`, `PROJECT_ID`, and `ACCESS_TOKEN` with the values you obtained earlier.
|
||||
Be sure to replace the `PROJECT_ID`, and `ACCESS_TOKEN` with the values you obtained earlier.
|
||||
If using a self-managed GitLab instance, replace `gitlab.com` with your self-managed instance hostname.
|
||||
|
||||
## View traces
|
||||
|
||||
|
Reference in New Issue
Block a user