Skip to content

PauliusLozys/zincsearch-metrics-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZincSearch metrics client

This metrics client provides io.Writer interface which writes documents to ZincSearch service.

Go Get

go get github.com/PauliusLozys/zincsearch-metrics-client

Example

func main() {
	w, err := zincmetric.New("http://localhost:4080", "admin", "admin", "test-service")
	if err != nil {
		panic(err)
	}
	defer w.Close()

	jsonLogger := slog.NewJSONHandler(w, nil)
	slog.SetDefault(slog.New(jsonLogger))

	slog.Info("test")
	slog.Info("test2")
	slog.Info("test3")
}

Options

Custom HTTP client can be passed using WithHttpClient
Custom metrics flush interval to ZincSearch service can be passed using WithFlushDuration (default: time.Second)

About

Client for writing metrics to ZincSearch service

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages