-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prometheus exporter http endpoint support
- Loading branch information
1 parent
8d67f82
commit 55287c5
Showing
98 changed files
with
27,170 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
"net/http" | ||
"testing" | ||
"time" | ||
|
||
"github.com/prometheus/client_golang/prometheus/promhttp" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestQueryExporter(t *testing.T) { | ||
go func() { | ||
http.Handle("/metrics", promhttp.Handler()) | ||
http.ListenAndServe(":7777", nil) | ||
}() | ||
|
||
time.Sleep(2 * time.Second) | ||
|
||
samples, err := QueryExporter("http://localhost:7777/metrics") | ||
|
||
assert.NoError(t, err) | ||
assert.NotNil(t, samples) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.