Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f032cab980 | |||
|
dbec05bdf7
|
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
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
|
## [0.0.1] - 2025-05-30
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// SetupOTelSDK bootstraps the OpenTelemetry pipeline.
|
// 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 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 func(context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}, err
|
}, err
|
||||||
|
|||||||
Reference in New Issue
Block a user