GSoul-hub commented on issue #4217:
URL:
https://github.com/apache/incubator-devlake/issues/4217#issuecomment-1473326512
Hi @Startrekzky.
I tried this one (slightly different than yours) and it seems to be working:
```
-- Metric 3: Median time to restore service
with _incidents as (
-- get the incidents created within the selected time period in the
top-right corner
SELECT
distinct i.id,
cast(lead_time_minutes as signed) as lead_time_minutes
FROM
issues i
join board_issues bi on i.id = bi.issue_id
join boards b on bi.board_id = b.id
join project_mapping pm on b.id = pm.row_id
left join issue_labels il on i.id = il.issue_id
WHERE
pm.project_name in ($project)
and i.type = 'INCIDENT'
and il.label_name = 'Production'
and $__timeFilter(i.created_date)
),
```
but I faced another problem - any panel related with deployments do not show
any data (Gitlab).
I looked through the queries (grafana->DORA) and database records and
noticed that the queries expects the type to be "deployment".
```
and type = 'DEPLOYMENT'
and result = 'SUCCESS'
and environment = 'PRODUCTION'
```
in database records (in my case) this value is empty for production (do not
know why)
I tried to comment/delete this line in queries, but it fixed only "Monthly
deployments" panel. Other panel still doesn't work.
e.g. "Deployment Frequence" shows result as "Fewer than once per six months".

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]