Skip to content

Commit

Permalink
removed prometheus metrics due to OTEL-operator issue in cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
somnathbm committed Dec 20, 2024
1 parent 1912f62 commit b68aa1e
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 538 deletions.
11 changes: 6 additions & 5 deletions src/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (
"hms_patient_mgmt_svc/db"

"github.com/gin-gonic/gin"
"github.com/penglongli/gin-metrics/ginmetrics"
// "github.com/penglongli/gin-metrics/ginmetrics"

"hms_patient_mgmt_svc/models"
)

func RunAppServer(appMonitor *ginmetrics.Monitor) *gin.Engine {
// func RunAppServer(appMonitor *ginmetrics.Monitor) *gin.Engine {
func RunAppServer() *gin.Engine {
appRouter := gin.Default()

// for service liveness check
Expand All @@ -33,8 +34,8 @@ func RunAppServer(appMonitor *ginmetrics.Monitor) *gin.Engine {
})
return
}
patientNum := len(result)
appMonitor.GetMetric("hms_patient_mgmt_patients_total").Add([]string{}, float64(patientNum))
// patientNum := len(result)
// appMonitor.GetMetric("hms_patient_mgmt_patients_total").Add([]string{}, float64(patientNum))
c.JSON(http.StatusOK, gin.H{
"data": result,
})
Expand Down Expand Up @@ -93,7 +94,7 @@ func RunAppServer(appMonitor *ginmetrics.Monitor) *gin.Engine {
patientData.Medical_info.PatientId = *insertResult

// increment the metrics
appMonitor.GetMetric("hms_patient_mgmt_patients_total").Inc([]string{})
// appMonitor.GetMetric("hms_patient_mgmt_patients_total").Inc([]string{})

c.JSON(http.StatusOK, gin.H{
"data": patientData,
Expand Down
31 changes: 13 additions & 18 deletions src/go.mod
Original file line number Diff line number Diff line change
@@ -1,57 +1,52 @@
module hms_patient_mgmt_svc

go 1.22.0
// go 1.22.0
go 1.21.6

toolchain go1.22.9
// toolchain go1.22.9
// toolchain go1.21.6

require (
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.6.0
go.mongodb.org/mongo-driver v1.17.1
go.mongodb.org/mongo-driver/v2 v2.0.0-beta2
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.2.0 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.10.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/penglongli/gin-metrics v0.1.12 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.12.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
go.mongodb.org/mongo-driver/v2 v2.0.0-beta2 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit b68aa1e

Please sign in to comment.