Skip to content

Commit e536f0b

Browse files
authored
DORA metrics for Github with OpenTelemetry Collector (#5718)
* feat(otel-github): DORA metrics for Github with OpenTelemetry Collector Signed-off-by: Nicolas Lamirault <[email protected]>
1 parent 613c1e3 commit e536f0b

File tree

4 files changed

+170
-0
lines changed

4 files changed

+170
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
# Copyright (C) Nicolas Lamirault <[email protected]>
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
apiVersion: v2
19+
type: application
20+
name: dora-github
21+
version: 1.0.0
22+
appVersion: 1.0.0
23+
dependencies:
24+
- name: opentelemetry-collector
25+
repository: https://open-telemetry.github.io/opentelemetry-helm-charts
26+
version: 0.108.0
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright (C) Nicolas Lamirault <[email protected]>
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
---
18+
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
19+
apiVersion: external-secrets.io/v1beta1
20+
kind: ExternalSecret
21+
metadata:
22+
labels:
23+
{{- include "opentelemetry-collector.labels" (index $.Subcharts "opentelemetry-collector") | nindent 4 }}
24+
name: otel-github-credentials
25+
namespace: {{ .Release.Namespace }}
26+
spec:
27+
refreshInterval: "1h"
28+
secretStoreRef:
29+
kind: ClusterSecretStore
30+
name: akeyless
31+
target:
32+
name: otel-github-credentials
33+
creationPolicy: Owner
34+
data:
35+
- secretKey: OTEL_GITHUB_PAT
36+
remoteRef:
37+
key: OTEL_GITHUB_PAT
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
# Copyright (C) Nicolas Lamirault <[email protected]>
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
opentelemetry-collector:
19+
resources:
20+
limits:
21+
# cpu: 250m
22+
memory: 512Mi
23+
requests:
24+
memory: 100Mi
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
# Copyright (C) Nicolas Lamirault <[email protected]>
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
opentelemetry-collector:
19+
additionalLabels:
20+
portefaix.xyz/version: v0.54.0
21+
22+
mode: "deployment"
23+
24+
image:
25+
repository: otel/opentelemetry-collector-contrib
26+
27+
extraEnvsFrom:
28+
- name: OTEL_GITHUB_PAT
29+
valueFrom:
30+
secretKeyRef:
31+
name: otel-github-credentials
32+
key: OTEL_GITHUB_PAT
33+
34+
config:
35+
extensions:
36+
health_check:
37+
endpoint: ${env:MY_POD_IP}:13133
38+
bearertokenauth/github:
39+
token: ${env:OTEL_GITHUB_PAT}
40+
41+
receivers:
42+
github/portefaix:
43+
initial_delay: 1s
44+
collection_interval: 60s
45+
scrapers:
46+
github:
47+
auth:
48+
authenticator: bearertokenauth/github
49+
github_org: portefaix
50+
search_query: org:portefaix
51+
metrics:
52+
vcs.repository.contributor.count:
53+
enabled: true
54+
git.repository.cve.count:
55+
enabled: true
56+
57+
processors:
58+
resource/portefaix:
59+
attributes:
60+
- key: team.name
61+
value: portefaix
62+
action: upsert
63+
64+
exporters:
65+
debug:
66+
verbosity: detailed
67+
# prometheus:
68+
# endpoint: 0.0.0.0:9090
69+
70+
service:
71+
extensions:
72+
- health_check
73+
- bearertokenauth/github
74+
pipelines:
75+
metrics:
76+
receivers:
77+
- github/portefaix
78+
processors:
79+
- resource/portefaix
80+
exporters:
81+
- debug
82+
- otlp
83+
# - prometheus

0 commit comments

Comments
 (0)