Documentation
¶
Overview ¶
Package prometheus holds the resources needed to start a Prometheus testcontainer container.
Package prometheus holds the resources needed to start a Prometheus testcontainer container.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prometheus ¶
type Prometheus struct {
Ports map[int]nat.Port
Network *testcontainers.DockerNetwork
Name string
// contains filtered or unexported fields
}
Prometheus holds the testcontainer, ports and network used by Jaeger. If instantiating yourself, be sure to populate Jaeger.Network, otherwise a new network will be generated.
func (*Prometheus) GetMetrics ¶
func (p *Prometheus) GetMetrics(expectedDataPoints int, maxRetries int, metricName string, service string, since time.Duration) (Metrics, string, error)
GetMetrics takes in a service names and returns the last n `metricName` events corresponding to that `service` over that `since`. There is a retry mechanism implemented; `GetMetrics` will keep fetching every 2 seconds, for a maximum of `maxRetries` times, until Prometheus returns `expectedDataPoints` number of metrics points.