Skip to content
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

expfmt.NewEncoder do not support custom encoder #269

Closed
hidu opened this issue Feb 7, 2021 · 3 comments
Closed

expfmt.NewEncoder do not support custom encoder #269

hidu opened this issue Feb 7, 2021 · 3 comments

Comments

@hidu
Copy link

hidu commented Feb 7, 2021

now is

switch format{
   case FmtProtoDelim:
  case xxx:
   panic(fmt.Errorf("expfmt.NewEncoder: unknown format %q", format))
}

expect:

switch format{
   case FmtProtoDelim:
  case xxx:
  default:
   // so we also need RegisiterEncoder(format,enc)
    if enc,ok:=encoders[format];ok{
       return enc
   }
   panic(fmt.Errorf("expfmt.NewEncoder: unknown format %q", format))
}
@roidelapluie
Copy link
Member

This repository is an internal prometheus library.

Formatting metrics can be tricky and I am not willing to have tens of ways to encode/decode metrics.

What is your use case? Which encoder are you willing to add?

Thanks.

@hidu
Copy link
Author

hidu commented Apr 27, 2021

in my company, we use our own system, but now the prometheus system is not ready.
so in my app, we expect use prometheus api now,and we can export to our old system.
when prometheus system is ready,then we switch it

@roidelapluie
Copy link
Member

I am unsure why you would be wiring to Prometheus at a so low level. However if you really want to do so I would recommend to have your temporary internal fork.

If you want more advices from the community I suggest you reach out to the mailing list or our discourse forum: https://prometheus.io/community

@hidu hidu closed this as completed May 8, 2021
alanprot pushed a commit to alanprot/common that referenced this issue Mar 15, 2023
* Use built in string conversion of recoder.Body
* Defer close after error check

VS Code complains otherwise.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants