2 Commits

Author SHA1 Message Date
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
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
## [0.1.0] - 2025-05-30
### 🚀 Features
- Add environment parameter to SetupOTelSDK function
## [0.0.1] - 2025-05-30
### 🚀 Features
+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