GitLab Standard Context Fields
Standard context, also referred to as Cloud context, describes all the fields available in the GitLab Standard Context schema.
Required Fields
Field | Type | Description | Example |
---|---|---|---|
environment | string | Name of the source environment. | "production" , "staging" |
Optional Fields
Field | Type | Description | Example |
---|---|---|---|
project_id | integer, null | ID of the associated project. This is available when tracking is done inside any project path. (example : GitLab project) | 12345 |
namespace_id | integer, null | ID of the associated namespace. This is available when tracking is done inside any group path. (example : GitLab-org) | 67890 |
user_id | integer, null | ID of the associated user. This gets pseudonymized in the Snowplow enricher. Refer to the metrics dictionary. | longhash |
global_user_id | string, null | An anonymized user_id hash unique across instances. | longhash |
is_gitlab_team_member | boolean, null | Indicates if the action was triggered by a GitLab team member. | true , false |
Instance Information
Field | Type | Description | Example |
---|---|---|---|
instance_id | string, null | ID of the GitLab instance where the request originated. | instance_long_uuid |
host_name | string, null | Hostname of the GitLab instance. | "gitlab-host-id" |
instance_version | string, null | Version of the GitLab instance. | "15.8.0" |
realm | string, null | Deployment type of GitLab. Must be one of: "self-managed" , "saas" , "dedicated" . | "saas" |
Client Information
Field | Type | Description | Example |
---|---|---|---|
client_name | string, null | Name of the client sending the request. | "chrome" , "jetbrains" |
client_version | string, null | Version of the client. | "108.0.5359.124" |
client_type | string, null | Type of client. | "browser" , "ide" |
interface | string, null | Interface from which the request originates. | "Duo Chat" |
Feature and Plan Information
Field | Type | Description | Example |
---|---|---|---|
feature_category | string, null | Category where the specific feature belongs. | "duo_chat" |
feature_enabled_by_namespace_ids | array, null | List of namespace IDs allowing the user to use the tracked feature. | [123, 456, 789] |
plan | string, null | Name of the subscription plan (maximum length: 32 characters). | "free" , "ultimate" |
Tracking and Context
Field | Type | Description | Example |
---|---|---|---|
source | string, null | Name of the source application. | "gitlab-rails" , "gitlab-javascript" |
google_analytics_id | string, null | Google Analytics ID from the marketing site. | "UA-XXXXXXXX-X" |
context_generated_at | string, null | Timestamp indicating when the context was generated. | "2023-12-20T10:00:00Z" |
correlation_id | string, null | Unique request ID for each request. | uuid |
extra | object, null | Additional data associated with the event, in key-value pair format. | {"key": "value"} |
Adding a New Field to the Standard Context
To add a new field to the standard context:
Create a merge request in the iglu repository to update the schema.
If the new field should be pseudonymized, add it to the ATTRIBUTE_TO_PSEUDONYMISE constant in the
snowplow-pseudonymization
project.Update the
GITLAB_STANDARD_SCHEMA_URL
in tracking/standard_context.rb to match the new version fromgitlab-org/iglu
.Start sending events that include the new field in Standard Context.
Related Links
- Descriptions of Unit Primitives are documented in cloud connector.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support