-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for push-gateway and OTLP #67
Conversation
62b66d3
to
d7d683c
Compare
6822648
to
0f137e5
Compare
8087511
to
5c28d1a
Compare
790f493
to
97bb5fa
Compare
// This is a useful function to use for setting a `job` key when | ||
// pushing metrics | ||
func GetOutboundIP() (net.IP, error) { | ||
conn, err := net.Dial("tcp", "1.1.1.1:80") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eehh this may be nasty behavior imo, it is quite unexpected for the autometrics library to make connections to the wide internet. definitely need to document this behavior more obviously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough
if pushConfiguration.CollectorURL == "" { | ||
return nil, errors.New("invalid PushConfiguration: the CollectorURL must be set.") | ||
} | ||
autometrics.SetPushJobURL(pushConfiguration.CollectorURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the behavior if a url without /v1/metrics
at the end gets inputted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Golang prometheus library adds that part itself, so it should be fine not adding the extra specification here. In the docs they don't mention the v1
part, but the gateway URL is still supposed to just be the root of the gateway.
Forced to update opentelemetry-go as well as there was no way to bring the update without also going into otel breaking changes.
Description
Add support for using "push"-based workflows with metrics:
...autometrics-go/prometheus
), autometrics will push the metrics to a given Push Gateway...autometrics-go/otel
), autometrics will push OTLP metrics periodically to a collector.This also forcefully updates opentelemetry libraries to 1.17/0.40
Checklist