# SDLC event ingest endpoint \[GitLab\]

**URL:** <https://community.dynatrace.com/t/sdlc-event-ingest-endpoint-gitlab/48490>\
**Category:** Automations\
**Tags:** release-monitoring, openpipeline, automations\
**Created:** [October 23, 2024, 7:39am UTC](https://community.dynatrace.com/t/sdlc-event-ingest-endpoint-gitlab/48490 "2024-10-23T07:39:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SofiaPersia](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sofiapersia/32/22940_2.png) [@SofiaPersia](https://community.dynatrace.com/u/SofiaPersia)\
**Post date:** [October 23, 2024, 7:39am UTC](https://community.dynatrace.com/t/sdlc-event-ingest-endpoint-gitlab/48490/1 "2024-10-23T07:39:29Z")

</div>

Hi&nbsp;[@JohannesBraeuer](https://community.dynatrace.com/user/33327),&nbsp;  
I just read your blog ([Observability throughout the SDLC](https://www.dynatrace.com/news/blog/observability-throughout-the-software-development-lifecycle/?))  
I’m currently working on ingesting pipelines from the GitLab environment.  
I used this procedure to receive the first test ingestion:

> **[Ingest SDLC events](https://docs.dynatrace.com/docs/deliver/pipeline-observability-sdlc-events/sdlc-events)**
>
> You can observe your pipeline through software development lifecycle (SDLC) events which you can then ingest to use to generate analytics.

However, it’s not clear how to receive all the pipeline information coming from GitLab. I was studying the webhook… but I must admit that a practical suggestion would be very helpful. I really hope you can assist me in understanding how to receive the complete pipeline information.

Thank you for your time.  
Best regards,

Sofia

---

<div class="post-metadata">

**Author:** ![MostafaHussein](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mostafahussein/32/2785_2.png) [@MostafaHussein](https://community.dynatrace.com/u/MostafaHussein)\
**Post date:** [October 23, 2024, 9:09am UTC](https://community.dynatrace.com/t/sdlc-event-ingest-endpoint-gitlab/48490/2 "2024-10-23T09:09:05Z")

</div>

after digging little within gitlab webhooks i found this [blog post](https://about.gitlab.com/blog/2016/08/19/applying-gitlab-labels-automatically/) that talks about&nbsp;`Applying GitLab Labels Automatically` and it’s mentioning how to push labels automatically with merge requests from&nbsp;Webrick server.

the following code explaining this and i think you can add little lines that sending the same data to dynatrace endpoint to be ingested as events "the endpoints was mentioned within&nbsp;[@JohannesBraeuer’s](https://community.dynatrace.com/user/33327) Article or you can check this doc. [link](https://docs.dynatrace.com/docs/shortlink/openpipeline-api-ingestion-reference#sdlc-events) "

```python
def update_labels(gitlab_server, api_key, request_body )
  project_id = request_body['object_attributes']['target_project_id']
  request_id = ['object_attributes']['id']
  labels = ['Needs Review'] if request_body['object_attributes']['action']
  semver_increment = semver_increment(gitlab_server, api_key,request_body )
  labels += semver_increment if semver_increment

  merge_data = {id: hook_id(hook), project_id: project_id(hook), labels: labels.to_a.sort.join(',')}
  url = "#{gitlab_server}/api/v3/projects/#{project_id}/merge_requests/#{request_id}?private_token=#{api_key}"
  RestClient::Request.execute(:method => :put, :payload => merge_data, :url => url)
end

def semver_increment(gitlab_server, api_key, request_body)
  from_branch = request_body['object_attributes']['target_branch']
  to_branch = request_body['object_attributes']['source_branch']
  project_id = request_body['object_attributes']['target_project_id']

  params = { private_token: api_key, from: from_branch, to: to_branch }
  url = "#{gitlab_server}/api/v3/projects/#{project_id}/repository/compare"
  changelog = JSON.parse(RestClient::Request.execute(:method => :get, :url => url, :headers => { params: params }))
  changelog = (changelog['commits'] || []).map { |commit| commit['message'] }
  return 'Major' if changelog.any? { |msg| msg.include? '#major' }
  return 'Minor' if changelog.any? { |msg| msg.include? '#minor' }
  return 'Patch' if changelog.any? { |msg| msg.include? '#patch' }
end

```

I hope this would be helpful.

BR,  
Mostafa Hussein.

---

<div class="post-metadata">

**Author:** ![SofiaPersia](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sofiapersia/32/22940_2.png) [@SofiaPersia](https://community.dynatrace.com/u/SofiaPersia)\
**Post date:** [October 28, 2024, 9:42am UTC](https://community.dynatrace.com/t/sdlc-event-ingest-endpoint-gitlab/48490/3 "2024-10-28T09:42:37Z")

</div>

Hi [@MostafaHussein](https://community.dynatrace.com/user/66935)&nbsp;,

I may not have expressed my requirements clearly. However, I found the solution by creating a test project in GitLab. I went to Settings, selected Webhooks, and entered the following URL as the endpoint:

https://{environmentid}.live.dynatrace.com/platform/ingest/v1/event.sdlc

and i configured the necessary custom headers, as listed on the **Openpipeline - Ingest API** :

 ![PipelineTest.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/7/47c016dd69c3dc56e5a1761ce8e6cca48ea5532e.png)

and sent the triggers I was interested in, specifically “ **Pipeline events**.”

 ![PipelineTestTrigger.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/4c382522b4a696d86c1b1f3cbe4e46d1ed9e88df.png)

Anyway, thank you so much for your response and the time you took to get back to me.  
Best regards,

Sofia
