Skip to content

gitlab: fix field type and value for event.duration #14299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/gitlab/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "2.3.1"
changes:
- description: Fix field type and value for `event.duration` to match ECS definition.
type: enhancement
link: https://github.com/elastic/integrations/pull/14299
- version: "2.3.0"
changes:
- description: Remove redundant installation instructions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4118,4 +4118,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -541,4 +541,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"category": [
"web"
],
"duration": 0.139,
"duration": 139000000,
"end": "2018-04-03T22:57:22.071Z",
"kind": "event",
"original": "{\"severity\": \"INFO\",\"time\": \"2018-04-03T22:57:22.071Z\",\"queue\": \"cronjob:update_all_mirrors\",\"args\": [],\"class\": \"UpdateAllMirrorsWorker\",\"retry\": false,\"queue_namespace\": \"cronjob\",\"jid\": \"06aeaa3b0aadacf9981f368e\",\"created_at\": \"2018-04-03T22:57:21.930Z\",\"enqueued_at\": \"2018-04-03T22:57:21.931Z\",\"pid\": 10077,\"worker_id\": \"sidekiq_0\",\"message\": \"UpdateAllMirrorsWorker JID-06aeaa3b0aadacf9981f368e: done: 0.139 sec\",\"job_status\": \"done\",\"duration\": 0.139,\"completed_at\": \"2018-04-03T22:57:22.071Z\",\"db_duration\": 0.05,\"db_duration_s\": 0.0005,\"gitaly_duration\": 0,\"gitaly_calls\": 0}",
Expand Down Expand Up @@ -48,4 +48,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ processors:
- rename:
field: gitlab.sidekiq.duration
target_field: event.duration
- script:
tag: convert_duration_to_nanoseconds
if: ctx.event?.duration instanceof double
source: |-
ctx.event.duration = (long) (ctx.event.duration*1e9)
- date:
field: gitlab.sidekiq.completed_at
formats:
Expand Down
24 changes: 12 additions & 12 deletions packages/gitlab/data_stream/sidekiq/sample_event.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"@timestamp": "2018-04-03T22:57:22.071Z",
"agent": {
"ephemeral_id": "cc5ea64a-1be7-4bf7-ac2e-a934734ba7d0",
"id": "d0298772-a948-4edb-95bf-6b9152967f34",
"name": "elastic-agent-16126",
"ephemeral_id": "0f0e4d1b-e9ae-4838-a977-c6c5126e05c4",
"id": "7963dc7d-539d-44df-84f6-9c8e5c85cd39",
"name": "elastic-agent-20780",
"type": "filebeat",
"version": "8.15.0"
"version": "8.13.0"
},
"data_stream": {
"dataset": "gitlab.sidekiq",
"namespace": "99205",
"namespace": "22209",
"type": "logs"
},
"ecs": {
"version": "8.11.0"
},
"elastic_agent": {
"id": "d0298772-a948-4edb-95bf-6b9152967f34",
"id": "7963dc7d-539d-44df-84f6-9c8e5c85cd39",
"snapshot": false,
"version": "8.15.0"
"version": "8.13.0"
},
"event": {
"agent_id_status": "verified",
"category": [
"web"
],
"dataset": "gitlab.sidekiq",
"duration": 0.139,
"duration": 139000000,
"end": "2018-04-03T22:57:22.071Z",
"ingested": "2024-09-23T21:03:08Z",
"ingested": "2025-06-23T23:00:47Z",
"kind": "event",
"original": "{\"severity\": \"INFO\",\"time\": \"2018-04-03T22:57:22.071Z\",\"queue\": \"cronjob:update_all_mirrors\",\"args\": [],\"class\": \"UpdateAllMirrorsWorker\",\"retry\": false,\"queue_namespace\": \"cronjob\",\"jid\": \"06aeaa3b0aadacf9981f368e\",\"created_at\": \"2018-04-03T22:57:21.930Z\",\"enqueued_at\": \"2018-04-03T22:57:21.931Z\",\"pid\": 10077,\"worker_id\": \"sidekiq_0\",\"message\": \"UpdateAllMirrorsWorker JID-06aeaa3b0aadacf9981f368e: done: 0.139 sec\",\"job_status\": \"done\",\"duration\": 0.139,\"completed_at\": \"2018-04-03T22:57:22.071Z\",\"db_duration\": 0.05,\"db_duration_s\": 0.0005,\"gitaly_duration\": 0,\"gitaly_calls\": 0}",
"severity": 6,
Expand Down Expand Up @@ -62,8 +62,8 @@
},
"log": {
"file": {
"device_id": "30",
"inode": "215",
"device_id": "38",
"inode": "1451225",
"path": "/tmp/service_logs/test-gitlab-sidekiq.log"
},
"offset": 0
Expand All @@ -77,4 +77,4 @@
"forwarded",
"gitlab-sidekiq"
]
}
}
22 changes: 11 additions & 11 deletions packages/gitlab/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1447,34 +1447,34 @@ An example event for `sidekiq` looks as following:
{
"@timestamp": "2018-04-03T22:57:22.071Z",
"agent": {
"ephemeral_id": "cc5ea64a-1be7-4bf7-ac2e-a934734ba7d0",
"id": "d0298772-a948-4edb-95bf-6b9152967f34",
"name": "elastic-agent-16126",
"ephemeral_id": "0f0e4d1b-e9ae-4838-a977-c6c5126e05c4",
"id": "7963dc7d-539d-44df-84f6-9c8e5c85cd39",
"name": "elastic-agent-20780",
"type": "filebeat",
"version": "8.15.0"
"version": "8.13.0"
},
"data_stream": {
"dataset": "gitlab.sidekiq",
"namespace": "99205",
"namespace": "22209",
"type": "logs"
},
"ecs": {
"version": "8.11.0"
},
"elastic_agent": {
"id": "d0298772-a948-4edb-95bf-6b9152967f34",
"id": "7963dc7d-539d-44df-84f6-9c8e5c85cd39",
"snapshot": false,
"version": "8.15.0"
"version": "8.13.0"
},
"event": {
"agent_id_status": "verified",
"category": [
"web"
],
"dataset": "gitlab.sidekiq",
"duration": 0.139,
"duration": 139000000,
"end": "2018-04-03T22:57:22.071Z",
"ingested": "2024-09-23T21:03:08Z",
"ingested": "2025-06-23T23:00:47Z",
"kind": "event",
"original": "{\"severity\": \"INFO\",\"time\": \"2018-04-03T22:57:22.071Z\",\"queue\": \"cronjob:update_all_mirrors\",\"args\": [],\"class\": \"UpdateAllMirrorsWorker\",\"retry\": false,\"queue_namespace\": \"cronjob\",\"jid\": \"06aeaa3b0aadacf9981f368e\",\"created_at\": \"2018-04-03T22:57:21.930Z\",\"enqueued_at\": \"2018-04-03T22:57:21.931Z\",\"pid\": 10077,\"worker_id\": \"sidekiq_0\",\"message\": \"UpdateAllMirrorsWorker JID-06aeaa3b0aadacf9981f368e: done: 0.139 sec\",\"job_status\": \"done\",\"duration\": 0.139,\"completed_at\": \"2018-04-03T22:57:22.071Z\",\"db_duration\": 0.05,\"db_duration_s\": 0.0005,\"gitaly_duration\": 0,\"gitaly_calls\": 0}",
"severity": 6,
Expand Down Expand Up @@ -1508,8 +1508,8 @@ An example event for `sidekiq` looks as following:
},
"log": {
"file": {
"device_id": "30",
"inode": "215",
"device_id": "38",
"inode": "1451225",
"path": "/tmp/service_logs/test-gitlab-sidekiq.log"
},
"offset": 0
Expand Down
2 changes: 1 addition & 1 deletion packages/gitlab/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 3.1.3
name: gitlab
title: GitLab
version: "2.3.0"
version: "2.3.1"
description: Collect logs from GitLab with Elastic Agent.
type: integration
categories:
Expand Down