Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Metrics not updated automatically #97

Open
@atul161

Description

@atul161

ctx, cancel := context.WithCancel(ctx)
defer cancel()

srv := &http.Server{
	Addr:    config.ServerHost + ":" + config.PromthesiusPort,
	Handler: promhttp.HandlerFor(promthesusConfig.Registry, promhttp.HandlerOpts{}),
}
//initializing metrics
promthesusConfig.ServerMetrics.InitializeMetrics(grpcServer)
grpc_prometheus.Register(grpcServer)
// graceful shutdown
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
	for range c {
		// sig is a ^C, handle it
	}
	_, cancel := context.WithTimeout(ctx, 30*time.Second)
	defer cancel()
	logger.Log.Info("graceful shutting down promthesius Server")
	_ = srv.Shutdown(ctx)
}()

when i open a port ..it already intiliased with the default metrics ...but when we hit new request on server ..then the details not updated automatically. After refreshing same problem happens

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions