-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 prometheus serializer #5427
Conversation
…legraf into prometheus_format
@aixeshunter Is it possible to have the prometheus output to use this code as well? @tomwilkie I know you are working around the code in the output, can you give an update on that? Hopefully we can avoid to many conflicts. |
@danielnelson Hi, I think the |
In the |
@danielnelson I think this feature wants to add new date format, this format can be used all outputs plugins. |
Almost this meaning:) |
This is a really useful feature that I'm looking forward to. And it's been half a year from the submission of this PR, any timeline to marge and release it? |
@brightzheng100 Hi, I wrote a new agent to receive data from |
Interesting. Is it open sourced? Where can I find it? @aixeshunter |
Anyway, while trying @aixeshunter's PR, it works perfectly fine for However, while trying The data, while being exported to file system via
And this is the [[outputs.http]]
## URL is the address to send metrics to
url = "http://10.197.81.43:9091/metrics/job/some_job/instance/cluster-01"
## Timeout for HTTP message
# timeout = "5s"
## HTTP method, one of: "POST" or "PUT"
method = "POST"
## HTTP Basic Auth credentials
# username = "username"
# password = "pa$$word"
## OAuth2 Client Credentials Grant
# client_id = "clientid"
# client_secret = "secret"
# token_url = "https://indentityprovider/oauth2/v1/token"
# scopes = ["urn:opc:idm:__myscopes__"]
## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
## Data format to output.
## Each data format has it's own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
# data_format = "influx"
data_format = "prometheus"
## Additional HTTP headers
[outputs.http.headers]
# # Should be set manually to "application/json" for json data_format
Content-Type = "application/x-www-form-urlencoded"
## HTTP Content-Encoding for write request body, can be set to "gzip" to
## compress body or "identity" to apply no encoding.
# content_encoding = "identity" Anything wrong? |
@brightzheng100 Have you checked the server's logs for any reason why it might be a 400? perhaps it doesn't like a header telegraf adds or something? |
I did. Unfortunately, there were no logs about things around this issue. And I did a What do you think, @glinton @aixeshunter ?
|
Interestingly, I tried many times and even hacked into the source code by printing more info, like headers, body info etc.
|
I open a new pull request (#6703) with a prometheus serializer that shares the transformation code with the prometheus output. I'd like to use this when we develop other prometheus output protocols, such as push gateway and (hopefully) remote write protocol. |
related #4414
Required for all PRs:
This PR addresses issue Add prometheus serializer #5350 by adding a Prometheus
. The prometheus data format can be supported by
file
output.