Skip to content

Commit 78704f2

Browse files
zmoogCopilot
andauthored
Fix helm support (#114)
- Update helm chart template for WS API v2 and OTLP exporter. - Add README.md - wavinsentio scraper: use in-memory identity manager Relates: - #112 --------- Co-authored-by: Copilot <[email protected]>
1 parent d80d062 commit 78704f2

File tree

9 files changed

+78
-81
lines changed

9 files changed

+78
-81
lines changed

go.work.sum

Lines changed: 11 additions & 54 deletions
Large diffs are not rendered by default.

helm/collector/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Helm
2+
3+
```sh
4+
# deploy using the Elasticsearch exporter
5+
helm template collector helm/collector \
6+
--set elasticsearch.endpoints="${ELASTICSEARCH_ENDPOINTS}" \
7+
--set elasticsearch.username="${ELASTICSEARCH_USERNAME}" \
8+
--set elasticsearch.password="${ELASTICSEARCH_PASSWORD}" \
9+
--set wavinsentio.username="${WS_USERNAME}" \
10+
--set wavinsentio.password="${WS_PASSWORD}" \
11+
--set zcsazzurro.client_id="${ZCS_CLIENT_ID}" \
12+
--set zcsazzurro.auth_key="${ZCS_AUTH_KEY}" \
13+
--set zcsazzurro.thing_key="${ZCS_THING_KEY}" \
14+
--set toggl.api_token="${TOGGL_API_TOKEN}" | k apply -f -
15+
16+
# deploy using the OTLP exporter
17+
helm template collector helm/collector \
18+
--set elasticsearch.endpoints="${ELASTICSEARCH_ENDPOINTS}" \
19+
--set elasticsearch.api_key="${ELASTICSEARCH_API_KEY}" \
20+
--set wavinsentio.username="${WS_USERNAME}" \
21+
--set wavinsentio.password="${WS_PASSWORD}" \
22+
--set zcsazzurro.client_id="${ZCS_CLIENT_ID}" \
23+
--set zcsazzurro.auth_key="${ZCS_AUTH_KEY}" \
24+
--set zcsazzurro.thing_key="${ZCS_THING_KEY}" \
25+
--set toggl.api_token="${TOGGL_API_TOKEN}" | k apply -f -
26+
```

helm/collector/templates/configmap.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: ConfigMap
44
metadata:
5-
name: {{.Release.Name}}-collector-config
5+
name: "{{.Release.Name}}-collector-config"
66
namespace: {{ .Release.Namespace }}
77
data:
88
collector-config.yaml: |
@@ -15,10 +15,11 @@ data:
1515
lookback: {{ .Values.toggl.lookback }}
1616
api_token: {{ .Values.toggl.api_token }}
1717
wavinsentio:
18-
interval: {{ .Values.wavinsentio.interval }}
19-
# interval: ${env:WS_INTERVAL:-30s}
18+
collection_interval: {{ .Values.wavinsentio.collection_interval }}
19+
endpoint: {{ .Values.wavinsentio.endpoint }}
2020
username: {{ .Values.wavinsentio.username }}
2121
password: {{ .Values.wavinsentio.password }}
22+
web_api_key: {{ .Values.wavinsentio.web_api_key }}
2223
zcsazzurro:
2324
interval: {{ .Values.zcsazzurro.interval }}
2425
client_id: {{ .Values.zcsazzurro.client_id }}
@@ -34,11 +35,15 @@ data:
3435
3536
# https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/elasticsearchexporter
3637
elasticsearch:
37-
endpoints: {{ .Values.elasticsearch.endpoints }}
38-
logs_index: logs-toggl.track-default
38+
endpoints: "{{ .Values.elasticsearch.endpoints }}"
3939
auth:
4040
authenticator: basicauth
4141
42+
otlp/elastic:
43+
endpoint: "{{ .Values.elasticsearch.endpoints }}"
44+
headers:
45+
Authorization: "ApiKey {{ .Values.elasticsearch.api_key }}"
46+
4247
extensions:
4348
basicauth:
4449
client_auth:
@@ -56,14 +61,12 @@ data:
5661
# receivers: [toggltrack]
5762
# exporters: [elasticsearch]
5863
metrics:
59-
# receivers: [wavinsentio, zcsazzurro]
60-
receivers: [zcsazzurro]
61-
# exporters: [elasticsearch]
62-
exporters: [debug, elasticsearch]
64+
receivers: [wavinsentio, zcsazzurro]
65+
exporters: [otlp/elastic]
6366
telemetry:
6467
resource:
65-
service.name: {{ .Release.Name }}
66-
service.version: {{ .Chart.AppVersion }}
68+
service.name: "{{ .Release.Name }}"
69+
service.version: "{{ .Chart.AppVersion }}"
6770
logs:
6871
level: debug
6972
# encoding: json

helm/collector/values.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image:
22
registry: ghcr.io/zmoog/collector
3-
tag: latest@sha256:4bd9c370e698f6dc5a44dd9a6f9a3d7f52ed207bc060c54aa774e39cb99992e7
3+
tag: latest@sha256:a07c861961e2e5a97c154757fda22b901850e5f4a66734d4d6b0c511225f4edb
44

55
labels:
66
hardware_profile: general-purpose
@@ -17,11 +17,17 @@ elasticsearch:
1717
endpoints: ""
1818
username: ""
1919
password: ""
20+
api_key: ""
2021

2122
wavinsentio:
22-
interval: "1m"
23+
collection_interval: "1m"
24+
# Production endpoint.
25+
endpoint: "https://blaze.wavinsentio.com/wavin.blaze.v1.BlazeDeviceService"
2326
username: ""
2427
password: ""
28+
# This is not a secret, it is the app in Firebase that is used
29+
# to authenticate with the Wavin Sentio API.
30+
web_api_key: "AIzaSyBlAtNI7-2jitPul9I-O4EZcT-n0sIay-g"
2531

2632
zcsazzurro:
2733
interval: "5m"

receiver/wavinsentioreceiver/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.25.1
44

55
require (
66
github.com/stretchr/testify v1.11.1
7-
github.com/zmoog/ws/v2 v2.0.0
7+
github.com/zmoog/ws/v2 v2.1.0
88
go.opentelemetry.io/collector/component v1.42.0
99
go.opentelemetry.io/collector/component/componenttest v0.136.0
1010
go.opentelemetry.io/collector/confmap v1.42.0
@@ -56,8 +56,8 @@ require (
5656
go.uber.org/multierr v1.11.0 // indirect
5757
go.yaml.in/yaml/v3 v3.0.4 // indirect
5858
golang.org/x/net v0.41.0 // indirect
59-
golang.org/x/sys v0.35.0 // indirect
60-
golang.org/x/text v0.26.0 // indirect
59+
golang.org/x/sys v0.36.0 // indirect
60+
golang.org/x/text v0.29.0 // indirect
6161
google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
6262
google.golang.org/grpc v1.75.1 // indirect
6363
google.golang.org/protobuf v1.36.9 // indirect

receiver/wavinsentioreceiver/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
5757
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
5858
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
5959
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
60-
github.com/zmoog/ws/v2 v2.0.0 h1:4he/jrfv2mevKW/6KzCgzSXta2A3yozsYaI+uAyYNj4=
61-
github.com/zmoog/ws/v2 v2.0.0/go.mod h1:Jl8cLao3qZL+tDGXDDVQIzRl3gbcUIHM6hCMvOzA7aA=
60+
github.com/zmoog/ws/v2 v2.1.0 h1:dSiEDiDJ7Ye/EewoOfN2wgHvxvNvJfohPeeWqvNkoA8=
61+
github.com/zmoog/ws/v2 v2.1.0/go.mod h1:Jl8cLao3qZL+tDGXDDVQIzRl3gbcUIHM6hCMvOzA7aA=
6262
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
6363
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
6464
go.opentelemetry.io/collector/component v1.42.0 h1:on4XJ/NT1oPnuCVKDEtlpcr3GGPAS9taWBe8woHSTmY=
@@ -146,12 +146,12 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
146146
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
147147
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
148148
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
149-
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
150-
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
149+
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
150+
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
151151
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
152152
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
153-
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
154-
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
153+
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
154+
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
155155
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
156156
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
157157
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=

receiver/wavinsentioreceiver/scraper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (s *wavinsentioScraper) scrape(_ context.Context) (pmetric.Metrics, error)
3838
}
3939

4040
func (s *wavinsentioScraper) start(_ context.Context, host component.Host) (err error) {
41-
identityManager := identity.NewManager(
41+
identityManager := identity.NewInMemoryManager(
4242
s.cfg.Username,
4343
s.cfg.Password,
4444
s.cfg.WebApiKey,

tools/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ require (
5050
github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect
5151
github.com/dimchansky/utfbom v1.1.1 // indirect
5252
github.com/distribution/reference v0.6.0 // indirect
53-
github.com/docker/cli v28.0.4+incompatible // indirect
53+
github.com/docker/cli v28.2.2+incompatible // indirect
5454
github.com/docker/distribution v2.8.3+incompatible // indirect
55-
github.com/docker/docker v28.1.1+incompatible // indirect
55+
github.com/docker/docker v28.2.2+incompatible // indirect
5656
github.com/docker/docker-credential-helpers v0.9.3 // indirect
5757
github.com/docker/go-connections v0.5.0 // indirect
5858
github.com/docker/go-units v0.5.0 // indirect
@@ -81,7 +81,7 @@ require (
8181
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
8282
github.com/google/certificate-transparency-go v1.3.1 // indirect
8383
github.com/google/go-cmp v0.7.0 // indirect
84-
github.com/google/go-containerregistry v0.20.4-0.20250225234217-098045d5e61f // indirect
84+
github.com/google/go-containerregistry v0.20.6 // indirect
8585
github.com/google/ko v0.18.0 // indirect
8686
github.com/google/safetext v0.0.0-20240722112252-5a72de7e7962 // indirect
8787
github.com/google/uuid v1.6.0 // indirect
@@ -154,7 +154,7 @@ require (
154154
go.opentelemetry.io/collector/internal/telemetry v0.136.0 // indirect
155155
go.opentelemetry.io/collector/pdata v1.42.0 // indirect
156156
go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 // indirect
157-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
157+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
158158
go.opentelemetry.io/otel v1.38.0 // indirect
159159
go.opentelemetry.io/otel/log v0.14.0 // indirect
160160
go.opentelemetry.io/otel/metric v1.38.0 // indirect

tools/go.sum

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr
143143
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
144144
github.com/docker/cli v28.0.4+incompatible h1:pBJSJeNd9QeIWPjRcV91RVJihd/TXB77q1ef64XEu4A=
145145
github.com/docker/cli v28.0.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
146+
github.com/docker/cli v28.2.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
146147
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
147148
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
148149
github.com/docker/docker v28.1.1+incompatible h1:49M11BFLsVO1gxY9UX9p/zwkE/rswggs8AdFmXQw51I=
149150
github.com/docker/docker v28.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
151+
github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
150152
github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8=
151153
github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo=
152154
github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=
@@ -238,6 +240,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
238240
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
239241
github.com/google/go-containerregistry v0.20.4-0.20250225234217-098045d5e61f h1:q+kbH7LI4wK3gNCxyvy2rFldJqAAB+Gch79/xj9/+GU=
240242
github.com/google/go-containerregistry v0.20.4-0.20250225234217-098045d5e61f/go.mod h1:UnXV0UkKqoHbzwn49vfozmwMcLMS8XLLsVKVuhv3cGc=
243+
github.com/google/go-containerregistry v0.20.6 h1:cvWX87UxxLgaH76b4hIvya6Dzz9qHB31qAwjAohdSTU=
244+
github.com/google/go-containerregistry v0.20.6/go.mod h1:T0x8MuoAoKX/873bkeSfLD2FAkwCDf9/HZgsFJ02E2Y=
241245
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
242246
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
243247
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -538,6 +542,7 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5
538542
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0/go.mod h1:ijPqXp5P6IRRByFVVg9DY8P5HkxkHE5ARIa+86aXPf4=
539543
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU=
540544
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ=
545+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q=
541546
go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8=
542547
go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM=
543548
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA=

0 commit comments

Comments
 (0)