12 Commits

Author SHA1 Message Date
Unbound Release 48bae2185f chore(release): prepare for v0.1.2 2025-06-16 15:31:31 +00:00
Renovate a75c28a6a3 fix(deps): update module github.com/99designs/gqlgen to v0.17.75 2025-06-16 14:51:40 +00:00
Renovate b87920eb3e chore(deps): update golang:1.24.4 docker digest to 3494bbe 2025-06-11 02:51:32 +00:00
Renovate 1f53311457 chore(deps): update pre-commit hook gitleaks/gitleaks to v8.27.2 2025-06-09 00:51:31 +00:00
Renovate d854b3852e chore(deps): update pre-commit hook gitleaks/gitleaks to v8.27.1 2025-06-08 02:51:25 +00:00
Renovate 9ce7f10a30 chore(deps): update golang docker tag to v1.24.4 2025-06-05 20:51:30 +00:00
Unbound Release 2f0ae8d4f1 chore(release): prepare for v0.1.1 2025-06-02 20:46:29 +02:00
Renovate d9f45d6007 fix(deps): update module github.com/99designs/gqlgen to v0.17.74 2025-06-02 17:51:22 +00:00
argoyle 0319b27e0b chore(pre-commit): update project reference for linter setup
Updates the project reference in the pre-commit configuration from
sentrysetup to otelsetup for improved traceability. This change
ensures that the linter correctly targets the new setup.
2025-06-01 20:34:18 +02:00
Renovate 5a26464d2a chore(deps): update pre-commit hook gitleaks/gitleaks to v8.27.0 2025-06-01 16:51:07 +00:00
Unbound Release f032cab980 chore(release): prepare for v0.1.0 2025-05-30 12:00:09 +00:00
argoyle dbec05bdf7 feat: add environment parameter to SetupOTelSDK function
Updates the SetupOTelSDK function to include an environment 
parameter. This change ensures that the OpenTelemetry setup 
now captures and sets the service environment along with 
the service name and version. It enhances observability 
by providing more context about the application's 
deployment environment.
2025-05-30 13:53:19 +02:00
6 changed files with 40 additions and 18 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ include:
- project: unboundsoftware/ci-templates
file: Pre-Commit-Go.gitlab-ci.yml
image: amd64/golang:1.24.3@sha256:f255a7d417e3733c9514bf8dd9c708b15b0ccd2543a850bed1d1198f42e476e2
image: amd64/golang:1.24.4@sha256:3494bbe140127d12656113203ec91b8e3ff34e8a2b06a0a22bb0d8a41cc69e53
stages:
- deps
@@ -32,7 +32,7 @@ test:
vulnerabilities:
stage: test
image: amd64/golang:1.24.3@sha256:f255a7d417e3733c9514bf8dd9c708b15b0ccd2543a850bed1d1198f42e476e2
image: amd64/golang:1.24.4@sha256:3494bbe140127d12656113203ec91b8e3ff34e8a2b06a0a22bb0d8a41cc69e53
script:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
+2 -2
View File
@@ -16,7 +16,7 @@ repos:
- id: gitlab-ci-linter
args:
- --project
- unboundsoftware/shiny/sentrysetup
- unboundsoftware/shiny/otelsetup
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.22.0
hooks:
@@ -41,6 +41,6 @@ repos:
hooks:
- id: golangci-lint-full
- repo: https://github.com/gitleaks/gitleaks
rev: v8.26.0
rev: v8.27.2
hooks:
- id: gitleaks
+22
View File
@@ -2,6 +2,28 @@
All notable changes to this project will be documented in this file.
## [0.1.2] - 2025-06-16
### 🐛 Bug Fixes
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.75
## [0.1.1] - 2025-06-02
### 🐛 Bug Fixes
- *(deps)* Update module github.com/99designs/gqlgen to v0.17.74
### ⚙️ Miscellaneous Tasks
- *(pre-commit)* Update project reference for linter setup
## [0.1.0] - 2025-05-30
### 🚀 Features
- Add environment parameter to SetupOTelSDK function
## [0.0.1] - 2025-05-30
### 🚀 Features
+4 -4
View File
@@ -3,7 +3,7 @@ module gitlab.com/unboundsoftware/shiny/otelsetup
go 1.24.3
require (
github.com/99designs/gqlgen v0.17.73
github.com/99designs/gqlgen v0.17.75
go.opentelemetry.io/otel v1.36.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.36.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.36.0
@@ -22,14 +22,14 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/sosodev/duration v1.3.1 // indirect
github.com/vektah/gqlparser/v2 v2.5.26 // indirect
github.com/vektah/gqlparser/v2 v2.5.28 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect
go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.25.0 // indirect
golang.org/x/text v0.26.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect
google.golang.org/grpc v1.72.1 // indirect
+8 -8
View File
@@ -1,5 +1,5 @@
github.com/99designs/gqlgen v0.17.73 h1:A3Ki+rHWqKbAOlg5fxiZBnz6OjW3nwupDHEG15gEsrg=
github.com/99designs/gqlgen v0.17.73/go.mod h1:2RyGWjy2k7W9jxrs8MOQthXGkD3L3oGr0jXW3Pu8lGg=
github.com/99designs/gqlgen v0.17.75 h1:GwHJsptXWLHeY7JO8b7YueUI4w9Pom6wJTICosDtQuI=
github.com/99designs/gqlgen v0.17.75/go.mod h1:p7gbTpdnHyl70hmSpM8XG8GiKwmCv+T5zkdY8U8bLog=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8=
@@ -27,8 +27,8 @@ github.com/sosodev/duration v1.3.1 h1:qtHBDMQ6lvMQsL15g4aopM4HEfOaYuhWBw3NPTtlqq
github.com/sosodev/duration v1.3.1/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/vektah/gqlparser/v2 v2.5.26 h1:REqqFkO8+SOEgZHR/eHScjjVjGS8Nk3RMO/juiTobN4=
github.com/vektah/gqlparser/v2 v2.5.26/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo=
github.com/vektah/gqlparser/v2 v2.5.28 h1:bIulcl3LF69ba6EiZVGD88y4MkM+Jxrf3P2MX8xLRkY=
github.com/vektah/gqlparser/v2 v2.5.28/go.mod h1:D1/VCZtV3LPnQrcPBeR/q5jkSQIPti0uYCP/RI0gIeo=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg=
@@ -59,12 +59,12 @@ go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9f
go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAjzlRhDwmVpZc=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237 h1:Kog3KlB4xevJlAcbbbzPfRG0+X9fdoGM+UBRKVz6Wr0=
google.golang.org/genproto/googleapis/api v0.0.0-20250519155744-55703ea1f237/go.mod h1:ezi0AVyMKDWy5xAncvjLWH7UcLBB5n7y2fQ8MzjJcto=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 h1:cJfm9zPbe1e873mHJzmQ1nwVEeRDU/T1wXDK2kUSU34=
+2 -2
View File
@@ -20,9 +20,9 @@ import (
)
// SetupOTelSDK bootstraps the OpenTelemetry pipeline.
func SetupOTelSDK(ctx context.Context, enabled bool, serviceName string, buildVersion string) (func(context.Context) error, error) {
func SetupOTelSDK(ctx context.Context, enabled bool, serviceName, buildVersion, environment string) (func(context.Context) error, error) {
if os.Getenv("OTEL_RESOURCE_ATTRIBUTES") == "" {
if err := os.Setenv("OTEL_RESOURCE_ATTRIBUTES", fmt.Sprintf("service.name=%s,service.version=%s", serviceName, buildVersion)); err != nil {
if err := os.Setenv("OTEL_RESOURCE_ATTRIBUTES", fmt.Sprintf("service.name=%s,service.version=%s,service.environment=%s", serviceName, buildVersion, environment)); err != nil {
return func(context.Context) error {
return nil
}, err