mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 06:29:02 +08:00
chore(telemetry): ✨ add deployment type (#875)
Signed-off-by: Prashant Shahi <prashant@signoz.io>
This commit is contained in:
parent
ab10a699b1
commit
561d18efec
@ -37,6 +37,11 @@ services:
|
||||
- STORAGE=clickhouse
|
||||
- POSTHOG_API_KEY=H-htDCae7CR3RV57gUzmol6IAKtm5IMCvbcm_fwnL-w
|
||||
- GODEBUG=netdns=go
|
||||
- TELEMETRY_ENABLED=true
|
||||
- DEPLOYMENT_TYPE=docker-swarm
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
depends_on:
|
||||
- clickhouse
|
||||
|
||||
|
@ -35,6 +35,8 @@ services:
|
||||
- STORAGE=clickhouse
|
||||
- GODEBUG=netdns=go
|
||||
- TELEMETRY_ENABLED=true
|
||||
- DEPLOYMENT_TYPE=docker-standalone-arm
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
clickhouse:
|
||||
condition: service_healthy
|
||||
|
@ -38,6 +38,8 @@ services:
|
||||
- STORAGE=clickhouse
|
||||
- GODEBUG=netdns=go
|
||||
- TELEMETRY_ENABLED=true
|
||||
- DEPLOYMENT_TYPE=docker-standalone-amd
|
||||
restart: on-failure
|
||||
depends_on:
|
||||
clickhouse:
|
||||
condition: service_healthy
|
||||
|
@ -3,6 +3,7 @@ package telemetry
|
||||
import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -111,6 +112,7 @@ func (a *Telemetry) SendEvent(event string, data map[string]interface{}) {
|
||||
// zap.S().Info(data)
|
||||
properties := analytics.NewProperties()
|
||||
properties.Set("version", version.GetVersion())
|
||||
properties.Set("deploymentType", getDeploymentType())
|
||||
|
||||
for k, v := range data {
|
||||
properties.Set(k, v)
|
||||
@ -159,3 +161,11 @@ func GetInstance() *Telemetry {
|
||||
|
||||
return telemetry
|
||||
}
|
||||
|
||||
func getDeploymentType() string {
|
||||
deploymentType := os.Getenv("DEPLOYMENT_TYPE")
|
||||
if deploymentType == "" {
|
||||
return "unknown"
|
||||
}
|
||||
return deploymentType
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user