-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into kav/ValueToUpperLower
- Loading branch information
Showing
50 changed files
with
1,446 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG GO_VERSION=1.18 | ||
ARG GO_VERSION=1.19 | ||
|
||
FROM golang:$GO_VERSION | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# DORA Metrics Integrations | ||
|
||
## Flex Integrations | ||
- GitLab DORA API | ||
- Group: query dora metrics in all repos in a single group | ||
- Repo: query dora metrics in a single repo | ||
|
||
## Requirements | ||
[DORA Entity Definition](https://github.com/newrelic/entity-definitions/blob/main/definitions/ext-dora/definition.yml) | ||
- Entity Creation | ||
- eventType: DoraMetricsSample | ||
- doraName: user defined doraName | ||
- doraName is used as an encapsulation, send metrics from mulitple sources to create a complete view on DORA metrics | ||
- must contain 1 of the 4 DORA Metrics to create an entity (recommended to send an event with all 4) | ||
- leadTimeForChanges | ||
- deploymentFrequency | ||
- timeToRestoreService | ||
- changeFailureRate | ||
- add a source attribute to allow filtering of different doraSources under the same entity | ||
- Optional: | ||
- Send supporting DORA metrics from different sources. | ||
- i.e. ci/cd tools, custom scripts, different repositories | ||
|
||
### **IMPORTANT** | ||
**doraName** needs to be a unique identifier for your entity creation | ||
|
||
### Example Payloads | ||
``` json | ||
[ | ||
{ | ||
"eventType": "DoraMetricsSample", | ||
"doraName": "Opencart", | ||
"projectId": 123456, | ||
"repoUrl": "https://gitlab.com/your/repo", | ||
"repoName": "opencart-tf", | ||
"deploymentFrequency": 15, | ||
"leadTimeForChanges": 12, | ||
"timeToRestoreService": 0.4, | ||
"changeFailureRate": 12.6, | ||
"team": "dev-rel-apj", | ||
"pipeline": "production-opencart", | ||
"org": "dev-rel", | ||
"source": "GitLab" | ||
}, | ||
{ | ||
"eventType": "DoraMetricsSample", | ||
"doraName": "Opencart", | ||
"repoName": "opencart-tf-infra", | ||
"deploymentFrequency": 15, | ||
"team": "dev-rel-sre", | ||
"pipeline": "production-opencart-infra", | ||
"org": "dev-rel", | ||
"source": "GitLab" | ||
}, | ||
{ | ||
"eventType": "DoraMetricsSample", | ||
"doraName": "Opencart", | ||
"deploymentFrequency": 1, | ||
"team": "dev-rel-sre", | ||
"pipeline": "production-opencart-ansible", | ||
"org": "dev-rel", | ||
"source": "ansible" | ||
} | ||
] | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#group level dora metrics | ||
--- | ||
integrations: | ||
- name: nri-flex | ||
interval: 300s | ||
env: | ||
INSIGHTS_URL: https://insights-collector.newrelic.com/v1/accounts/<accountid>/events | ||
INSIGHTS_API_KEY: <insertkey> | ||
config: | ||
name: gitlabDoraMetrics | ||
global: | ||
base_url: https://gitlab.com/api/v4 | ||
headers: | ||
PRIVATE-TOKEN: <accesstoken> | ||
apis: | ||
- name: doraGroup | ||
url: /groups/<groupid>/projects | ||
jq: .[]|with_entries(select([.key] | inside(["id", "namespace.path", "path"]))) | ||
store_lookups: | ||
projectId: id | ||
rename_keys: | ||
namespace.name: org | ||
path: repoName | ||
add_attribute: | ||
doraName: "${org}-${repoName}" | ||
value_parser: | ||
id: '[0-9]+' | ||
metric_parser: | ||
metrics: | ||
id: ATTRIBUTE | ||
namespace: | ||
custom_attr: 'dora' | ||
|
||
value_parser: | ||
.*: 'nil' | ||
|
||
merge: DoraMetricsSample | ||
join_key: id | ||
|
||
- name: DoraDeploymentSample | ||
run_async: true | ||
url: /projects/${lookup:projectId}/dora/metrics?metric=deployment_frequency&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"deploymentFrequency":.value,"projectid":"${lookup:projectId}"} | ||
metric_parser: | ||
metrics: | ||
projectid: ATTRIBUTE | ||
namespace: | ||
custom_attr: 'dora' | ||
|
||
merge: DoraMetricsSample | ||
join_key: projectid | ||
|
||
- name: change_failure_rate | ||
run_async: true | ||
url: /projects/${lookup:projectId}/dora/metrics?metric=change_failure_rate&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"changeFailureRate":.value,"projectid":"${lookup:projectId}"} | ||
metric_parser: | ||
metrics: | ||
projectid: ATTRIBUTE | ||
namespace: | ||
custom_attr: 'dora' | ||
|
||
merge: DoraMetricsSample | ||
join_key: projectid | ||
|
||
- name: time_to_restore_service | ||
run_async: true | ||
url: /projects/${lookup:projectId}/dora/metrics?metric=time_to_restore_service&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"timeToRestoreService":.value,"projectid":"${lookup:projectId}"} | ||
metric_parser: | ||
metrics: | ||
projectid: ATTRIBUTE | ||
namespace: | ||
custom_attr: 'dora' | ||
|
||
merge: DoraMetricsSample | ||
join_key: projectid | ||
|
||
|
||
- name: lead_time_for_changes | ||
run_async: true | ||
url: /projects/${lookup:projectId}/dora/metrics?metric=lead_time_for_changes&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"leadTimeForChanges":.value,"projectid":"${lookup:projectId}"} | ||
metric_parser: | ||
metrics: | ||
projectid: ATTRIBUTE | ||
namespace: | ||
custom_attr: 'dora' | ||
|
||
merge: DoraMetricsSample | ||
join_key: projectid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#repo level dora metrics | ||
--- | ||
integrations: | ||
- name: nri-flex | ||
interval: 300s | ||
env: | ||
INSIGHTS_URL: https://insights-collector.newrelic.com/v1/accounts/<accountid>/events | ||
INSIGHTS_API_KEY: <insertkey> | ||
config: | ||
name: gitlabDoraMetrics | ||
variable_store: | ||
projectId: <projectId> #your gitlab projectId | ||
custom_attributes: | ||
doraName: <doraName> # required for entity creation needs to be unique | ||
pipeline: <pipeline> | ||
team: <team> | ||
repoName: <repoName> | ||
org: <org> | ||
global: | ||
base_url: https://gitlab.com/api/v4 | ||
headers: | ||
PRIVATE-TOKEN: <accesstoken> | ||
apis: | ||
- name: deployment_frequency | ||
run_async: true | ||
url: /projects/${var:projectId}/dora/metrics?metric=deployment_frequency&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"deploymentFrequency":.value} | ||
merge: DoraMetricsSample | ||
|
||
- name: change_failure_rate | ||
run_async: true | ||
url: /projects/${var:projectId}/dora/metrics?metric=change_failure_rate&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"changeFailureRate":.value} | ||
merge: DoraMetricsSample | ||
|
||
- name: time_to_restore_service | ||
run_async: true | ||
url: /projects/${var:projectId}/dora/metrics?metric=time_to_restore_service&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"timeToRestoreService":.value} | ||
merge: DoraMetricsSample | ||
|
||
- name: lead_time_for_changes | ||
run_async: true | ||
url: /projects/${var:projectId}/dora/metrics?metric=lead_time_for_changes&start_date=${timestamp:dateutc-24hr} | ||
jq: > | ||
.[-1]|{"leadTimeForChanges":.value} | ||
merge: DoraMetricsSample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd /home/$1/sqllib | ||
|
||
. ./db2profile | ||
|
||
db2 connect to $2 | ||
|
||
db2 -x "SELECT SNAPSHOT_TIMESTAMP, AUTHID, APPL_NAME, AGENT_ID, PERCENT_ROWS_SELECTED, DBPARTITIONNUM, MEMBER FROM SYSIBMADM.APPL_PERFORMANCE" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd /home/$1/sqllib | ||
|
||
. ./db2profile | ||
|
||
db2 connect to $2 | ||
|
||
db2 -x "SELECT SNAPSHOT_TIMESTAMP, DB_NAME, BP_NAME, TOTAL_LOGICAL_READS, TOTAL_PHYSICAL_READS, TOTAL_HIT_RATIO_PERCENT, DATA_LOGICAL_READS, DATA_PHYSICAL_READS, DATA_HIT_RATIO_PERCENT, INDEX_LOGICAL_READS, INDEX_PHYSICAL_READS, INDEX_HIT_RATIO_PERCENT, XDA_LOGICAL_READS, XDA_PHYSICAL_READS, XDA_HIT_RATIO_PERCENT, DBPARTITIONNUM, MEMBER FROM SYSIBMADM.BP_HITRATIO" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd /home/$1/sqllib | ||
|
||
. ./db2profile | ||
|
||
db2 connect to $2 | ||
|
||
db2 -x "SELECT SNAPSHOT_TIMESTAMP, BP_NAME, TOTAL_PHYSICAL_READS, AVERAGE_READ_TIME_MS, TOTAL_ASYNC_READS, AVERAGE_ASYNC_READ_TIME_MS, TOTAL_SYNC_READS, AVERAGE_SYNC_READ_TIME_MS, PERCENT_SYNC_READS, ASYNC_NOT_READ_PERCENT, DBPARTITIONNUM, MEMBER FROM SYSIBMADM.BP_READ_IO" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd /home/$1/sqllib | ||
|
||
. ./db2profile | ||
|
||
db2 connect to $2 | ||
|
||
db2 -x "SELECT APPLICATION_HANDLE, TOTAL_CPU_TIME, ROWS_READ, ROWS_RETURNED, TOTAL_WAIT_TIME, TOTAL_SORTS FROM TABLE(MON_GET_UNIT_OF_WORK(NULL,-1)) AS t ORDER BY TOTAL_CPU_TIME DESC" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd /home/$1/sqllib | ||
|
||
. ./db2profile | ||
|
||
db2 connect to $2 | ||
|
||
db2 -x "SELECT SNAPSHOT_TIMESTAMP, DB_NAME, AGENT_ID, APPL_NAME, AUTHID, TBSP_NAME, TABSCHEMA, TABNAME, SUBSECTION_NUMBER, LOCK_OBJECT_TYPE, LOCK_WAIT_START_TIME, LOCK_NAME, LOCK_MODE, LOCK_MODE_REQUESTED, AGENT_ID_HOLDING_LK, APPL_ID_HOLDING_LK, LOCK_ESCALATION, DBPARTITIONNUM, MEMBER FROM SYSIBMADM.LOCKWAITS" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd /home/$1/sqllib | ||
|
||
. ./db2profile | ||
|
||
db2 connect to $2 | ||
|
||
db2 -x "SELECT SNAPSHOT_TIMESTAMP, DB_NAME, AGENT_ID, APPL_NAME, AUTHID, TBSP_NAME, TABSCHEMA, TABNAME, TAB_FILE_ID, LOCK_OBJECT_TYPE, LOCK_NAME, LOCK_MODE, LOCK_STATUS, LOCK_ESCALATION, DBPARTITIONNUM, MEMBER FROM SYSIBMADM.LOCKS_HELD" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd /home/$1/sqllib | ||
|
||
. ./db2profile | ||
|
||
db2 connect to $2 | ||
|
||
db2 -x "SELECT LOG_UTILIZATION_PERCENT, cast(( TOTAL_LOG_USED_KB/1024) as Integer) as TOTAL_LOG_USED_MB, cast((TOTAL_LOG_AVAILABLE_KB/1024) as Integer) as TOTAL_LOG_AVAILABLE_MB, cast((TOTAL_LOG_USED_TOP_KB/1024) as integer) as TOTAL_LOG_USED_TOP_MB from SYSIBMADM.MON_TRANSACTION_LOG_UTILIZATION" | ||
|
||
exit 0 |
Oops, something went wrong.