George
11/03/2022, 6:21 PMAlexei Zenin
11/03/2022, 9:01 PMJose Almir
11/04/2022, 11:36 AMMallesh Kannan
11/04/2022, 12:41 PM{
"data": null,
"total": 0,
"limit": 0,
"offset": 0,
"errors": [
{
"code": 500,
"msg": "Error in processing sql query: code: 516, message: admin: Authentication failed: password is incorrect or there is no user with such name"
}
]
}
can any one help me on this pleaseMallesh Kannan
11/04/2022, 12:45 PMAlexei Zenin
11/04/2022, 5:48 PM[31mERROR[0m clickhouseReader/reader.go:2275 error while setting storage policy. Err=code: 36, message: New storage policy `default` shall contain volumes of old one
<http://go.signoz.io/signoz/pkg/query-service/app/clickhouseReader.(*ClickHouseReader).setColdStorage|go.signoz.io/signoz/pkg/query-service/app/clickhouseReader.(*ClickHouseReader).setColdStorage>
/go/src/github.com/signoz/signoz/pkg/query-service/app/clickhouseReader/reader.go:2275
<http://go.signoz.io/signoz/pkg/query-service/app/clickhouseReader.(*ClickHouseReader).SetTTL.func2|go.signoz.io/signoz/pkg/query-service/app/clickhouseReader.(*ClickHouseReader).SetTTL.func2>
/go/src/github.com/signoz/signoz/pkg/query-service/app/clickhouseReader/reader.go:2119
Alexei Zenin
11/04/2022, 6:10 PMSibaprasad Tripathy
11/07/2022, 6:46 AMpackage main
import (
"context"
"encoding/json"
"io"
"net/http"
"os"
"strconv"
"<http://github.com/gin-gonic/gin|github.com/gin-gonic/gin>"
_ "<http://github.com/go-sql-driver/mysql|github.com/go-sql-driver/mysql>"
"<http://github.com/gorilla/mux|github.com/gorilla/mux>"
"<http://github.com/jinzhu/gorm|github.com/jinzhu/gorm>"
_ "<http://github.com/jinzhu/gorm/dialects/mysql|github.com/jinzhu/gorm/dialects/mysql>"
"<http://github.com/rs/cors|github.com/rs/cors>"
log "<http://github.com/sirupsen/logrus|github.com/sirupsen/logrus>"
"<http://go.opentelemetry.io/otel|go.opentelemetry.io/otel>"
"<http://go.opentelemetry.io/otel/attribute|go.opentelemetry.io/otel/attribute>"
"<http://go.opentelemetry.io/otel/exporters/otlp/otlptrace|go.opentelemetry.io/otel/exporters/otlp/otlptrace>"
"<http://go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc|go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc>"
"<http://google.golang.org/grpc/credentials|google.golang.org/grpc/credentials>"
"<http://go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin|go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin>"
"<http://go.opentelemetry.io/otel/sdk/resource|go.opentelemetry.io/otel/sdk/resource>"
sdktrace "<http://go.opentelemetry.io/otel/sdk/trace|go.opentelemetry.io/otel/sdk/trace>"
)
var db, _ = gorm.Open("mysql", "root:root@/todolist?charset=utf8&parseTime=True&loc=Local")
var (
serviceName = os.Getenv("SERVICE_NAME")
collectorURL = os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
insecure = os.Getenv("INSECURE_MODE")
)
func initTracer() func(context.Context) error {
secureOption := otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, ""))
if len(insecure) > 0 {
secureOption = otlptracegrpc.WithInsecure()
}
log.Printf("entering init trace", collectorURL)
exporter, err := otlptrace.New(
context.Background(),
otlptracegrpc.NewClient(
secureOption,
otlptracegrpc.WithEndpoint(collectorURL),
),
)
if err != nil {
log.Fatal(err)
}
resources, err := resource.New(
context.Background(),
resource.WithAttributes(
attribute.String("service.name", serviceName),
attribute.String("library.language", "go"),
),
)
if err != nil {
log.Printf("Could not set resources: ", err)
}
otel.SetTracerProvider(
sdktrace.NewTracerProvider(
sdktrace.WithSampler(sdktrace.AlwaysSample()),
sdktrace.WithBatcher(exporter),
sdktrace.WithResource(resources),
),
)
return exporter.Shutdown
}
type TodoItemModel struct {
Id int `gorm:"primary_key"`
Description string
Completed bool
}
func CreateItem(w http.ResponseWriter, r *http.Request) {
description := r.FormValue("description")
log.WithFields(log.Fields{"description": description}).Info("Add new TodoItem. Saving to database.")
todo := &TodoItemModel{Description: description, Completed: false}
db.Create(&todo)
result := db.Last(&todo)
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(result.Value)
}
func UpdateItem(w http.ResponseWriter, r *http.Request) {
// Get URL parameter from mux
vars := mux.Vars(r)
id, _ := strconv.Atoi(vars["id"])
// Test if the TodoItem exist in DB
err := GetItemByID(id)
if err == false {
w.Header().Set("Content-Type", "application/json")
io.WriteString(w, `{"updated": false, "error": "Record Not Found"}`)
} else {
completed, _ := strconv.ParseBool(r.FormValue("completed"))
log.WithFields(log.Fields{"Id": id, "Completed": completed}).Info("Updating TodoItem")
todo := &TodoItemModel{}
db.First(&todo, id)
todo.Completed = completed
db.Save(&todo)
w.Header().Set("Content-Type", "application/json")
io.WriteString(w, `{"updated": true}`)
}
}
func DeleteItem(w http.ResponseWriter, r *http.Request) {
// Get URL parameter from mux
vars := mux.Vars(r)
id, _ := strconv.Atoi(vars["id"])
// Test if the TodoItem exist in DB
err := GetItemByID(id)
if err == false {
w.Header().Set("Content-Type", "application/json")
io.WriteString(w, `{"deleted": false, "error": "Record Not Found"}`)
} else {
log.WithFields(log.Fields{"Id": id}).Info("Deleting TodoItem")
todo := &TodoItemModel{}
db.First(&todo, id)
db.Delete(&todo)
w.Header().Set("Content-Type", "application/json")
io.WriteString(w, `{"deleted": true}`)
}
}
func GetItemByID(Id int) bool {
todo := &TodoItemModel{}
result := db.First(&todo, Id)
if result.Error != nil {
log.Warn("TodoItem not found in database")
return false
}
return true
}
func GetCompletedItems(w http.ResponseWriter, r *http.Request) {
<http://log.Info|log.Info>("Get completed TodoItems")
completedTodoItems := GetTodoItems(true)
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(completedTodoItems)
}
func GetIncompleteItems(w http.ResponseWriter, r *http.Request) {
<http://log.Info|log.Info>("Get Incomplete TodoItems")
IncompleteTodoItems := GetTodoItems(false)
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(IncompleteTodoItems)
}
func GetTodoItems(completed bool) interface{} {
var todos []TodoItemModel
TodoItems := db.Where("completed = ?", completed).Find(&todos).Value
return TodoItems
}
func Healthz(w http.ResponseWriter, r *http.Request) {
<http://log.Info|log.Info>("API Health is OK")
w.Header().Set("Content-Type", "application/json")
io.WriteString(w, `{"alive": true}`)
}
func init() {
log.SetFormatter(&log.TextFormatter{})
log.SetReportCaller(true)
}
func main() {
cleanup := initTracer()
defer cleanup(context.Background())
r := gin.Default()
r.Use(otelgin.Middleware(serviceName))
log.Println(serviceName, "serviceName")
defer db.Close()
db.Debug().DropTableIfExists(&TodoItemModel{})
db.Debug().AutoMigrate(&TodoItemModel{})
<http://log.Info|log.Info>("Starting Todolist API server")
router := mux.NewRouter()
router.HandleFunc("/healthz", Healthz).Methods("GET")
router.HandleFunc("/todo-completed", GetCompletedItems).Methods("GET")
router.HandleFunc("/todo-incomplete", GetIncompleteItems).Methods("GET")
router.HandleFunc("/todo", CreateItem).Methods("POST")
router.HandleFunc("/todo/{id}", UpdateItem).Methods("POST")
router.HandleFunc("/todo/{id}", DeleteItem).Methods("DELETE")
http.ListenAndServe(":8000", router)
handler := cors.New(cors.Options{
AllowedMethods: []string{"GET", "POST", "DELETE", "PATCH", "OPTIONS"},
}).Handler(router)
http.ListenAndServe(":8000", handler)
}
Shivvinay Kanswal
11/07/2022, 11:36 AMMariano Mirabelli
11/07/2022, 7:10 PMmax(sum(rate(signoz_calls_total{service_name="ktor-test", operation=~`HTTP GET|HTTP POST`, status_code="STATUS_CODE_ERROR"}[5m]) OR rate(signoz_calls_total{service_name="ktor-test", operation=~`HTTP GET|HTTP POST`, http_status_code=~"5.."}[5m]))*100/sum(rate(signoz_calls_total{service_name="ktor-test", operation=~`HTTP GET|HTTP POST`}[5m]))) < 1000 OR vector(0)
And my condition on the Alert are the following:
• Send a notification when the metric is: above
• the threshold: at least once
• Alert Threshold: 5
Thanks in advance!Himanshu Jain
11/08/2022, 7:27 AMLars von trier pung
11/08/2022, 7:42 AMShivvinay Kanswal
11/08/2022, 12:28 PMDevops Netapp
11/08/2022, 4:34 PMNestor René Juárez Montes de Oca
11/09/2022, 2:25 AMJose Almir
11/09/2022, 8:20 PMJason Schmidt
11/09/2022, 9:31 PMWejdan
11/10/2022, 11:49 AMItay Baror
11/11/2022, 3:28 PMJose Almir
11/12/2022, 4:16 PMJose Almir
11/12/2022, 4:18 PMApoorva
11/13/2022, 6:46 AMGladium 25
11/13/2022, 11:48 AMAnant Vashishtha
11/14/2022, 5:10 AMNicoGnaw
11/14/2022, 9:31 AMVignesh
11/14/2022, 11:31 AMHimanshu Jain
11/15/2022, 8:59 AMBogdan Butusov
11/15/2022, 12:37 PMTimothy Wigginton
11/15/2022, 5:15 PME1115 16:56:11.312079 1 connection.go:105] connect():FAILED Ping(http://***:***@chi-signoz-chart-clickhouse-cluster-0-0.default.svc.cluster.local:8123/). Err: dial tcp: lookup chi-signoz-chart-clickhouse-cluster-0-0.default.svc.cluster.local on 10.100.0.10:53: no such host
Hima Vyas
11/15/2022, 6:11 PM