Skip to content

snapp-incubator/exporting-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exporting Platform

Develop

To run the code in your development environment:

# run with default config located in configs/config.yml
go run cmd/main.go

# run with filled config located in configs/config_filled.yml
go run cmd/main.go configs/config_filled.yml

Add Exporters

To add a new exporter, you should create a file inside internal/exporters and add your new collector struct there and add new fields with type *prometheus.Desc. After that, you should create the New function for that struct and create prometheus.Desc objects there.

After creating New function, you should implement two methods for your struct.

  • Describe: which passes a read-only channel of type *prometheus.Desc and you should pass each Desc object you had in struct to it.
  • Collect: which passes a read-only channel of type prometheus.Metric and you should implement the exporting logic here. After that, you should return objects of type prometheus.MustNewConstMetric to the channel.

About

a platform to write missed metrics from well-known exporters

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •