mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 19:39: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
|
- STORAGE=clickhouse
|
||||||
- POSTHOG_API_KEY=H-htDCae7CR3RV57gUzmol6IAKtm5IMCvbcm_fwnL-w
|
- POSTHOG_API_KEY=H-htDCae7CR3RV57gUzmol6IAKtm5IMCvbcm_fwnL-w
|
||||||
- GODEBUG=netdns=go
|
- GODEBUG=netdns=go
|
||||||
|
- TELEMETRY_ENABLED=true
|
||||||
|
- DEPLOYMENT_TYPE=docker-swarm
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
- clickhouse
|
- clickhouse
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ services:
|
|||||||
- STORAGE=clickhouse
|
- STORAGE=clickhouse
|
||||||
- GODEBUG=netdns=go
|
- GODEBUG=netdns=go
|
||||||
- TELEMETRY_ENABLED=true
|
- TELEMETRY_ENABLED=true
|
||||||
|
- DEPLOYMENT_TYPE=docker-standalone-arm
|
||||||
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
clickhouse:
|
clickhouse:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
@ -38,6 +38,8 @@ services:
|
|||||||
- STORAGE=clickhouse
|
- STORAGE=clickhouse
|
||||||
- GODEBUG=netdns=go
|
- GODEBUG=netdns=go
|
||||||
- TELEMETRY_ENABLED=true
|
- TELEMETRY_ENABLED=true
|
||||||
|
- DEPLOYMENT_TYPE=docker-standalone-amd
|
||||||
|
restart: on-failure
|
||||||
depends_on:
|
depends_on:
|
||||||
clickhouse:
|
clickhouse:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
@ -3,6 +3,7 @@ package telemetry
|
|||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -111,6 +112,7 @@ func (a *Telemetry) SendEvent(event string, data map[string]interface{}) {
|
|||||||
// zap.S().Info(data)
|
// zap.S().Info(data)
|
||||||
properties := analytics.NewProperties()
|
properties := analytics.NewProperties()
|
||||||
properties.Set("version", version.GetVersion())
|
properties.Set("version", version.GetVersion())
|
||||||
|
properties.Set("deploymentType", getDeploymentType())
|
||||||
|
|
||||||
for k, v := range data {
|
for k, v := range data {
|
||||||
properties.Set(k, v)
|
properties.Set(k, v)
|
||||||
@ -159,3 +161,11 @@ func GetInstance() *Telemetry {
|
|||||||
|
|
||||||
return 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