6 Commits

Author SHA1 Message Date
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
5 changed files with 26 additions and 10 deletions
+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.0
hooks:
- id: gitleaks
+16
View File
@@ -2,6 +2,22 @@
All notable changes to this project will be documented in this file.
## [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
+2 -2
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.74
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,7 +22,7 @@ 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.27 // 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
+4 -4
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.74 h1:1FuVtkXxOc87xpKio3f6sohREmec+Jvy86PcYOuwgWo=
github.com/99designs/gqlgen v0.17.74/go.mod h1:a+iR6mfRLNRp++kDpooFHiPWYiWX3Yu1BIilQRHgh10=
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.27 h1:RHPD3JOplpk5mP5JGX8RKZkt2/Vwj/PZv0HxTdwFp0s=
github.com/vektah/gqlparser/v2 v2.5.27/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=
+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