--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Krasi Georgiev | |
There is another approach for swagger spec auto generation from an existing code using annotations. This way we can benefit from auto generated docs without the swagger lock-in.I have been trying out both "go code + annotations -> openapi spec" aswell as "openapi spec -> go code". I have quickly hit the limits of whatcan be specified via the goswagger annotations feature. Thereby I havefocused on the latter process ("openapi spec -> go code") in my proof ofconcept.
Additional general benefit that came to my mind is basic generated userinput validation logic.
> What's your plan for alert ingestion?
You are talking about `api.legacyAddAlerts` [1] or `api.addAlerts` [2]?
I would see the former as API v0 and the latter as API v1. I would
suggest deprecating both within the v1 deprecation period (see below).
> If we're going to move to something new, I see no need to keep any other part of our undocumented API.
I would suggest maintaining v1 and v2 for a transitioning period and
eventually deprecate v1 (and v0) in favour of v2.
> There is another approach for swagger spec auto generation from an existing code using annotations. This way we can benefit from auto generated docs without the swagger lock-in.
> https://goswagger.io/generate/spec.html
I have been trying out both "go code + annotations -> openapi spec" as
well as "openapi spec -> go code". I have quickly hit the limits of what
can be specified via the goswagger annotations feature. Thereby I have
focused on the latter process ("openapi spec -> go code") in my proof of
concept.
Additional general benefit that came to my mind is basic generated user
input validation logic.
[1] https://github.com/prometheus/alertmanager/blob/master/api/api.go#L137
[2] https://github.com/prometheus/alertmanager/blob/master/api/api.go#L147
> <mailto:prometheus-developers+unsub...@googlegroups.com>.> an email to prometheus-developers+unsub...@googlegroups.com
> To post to this group, send email to
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/f6ea9174-8145-75f5-fa5c-f07a52e74eb5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
> <mailto:prometheus-devel...@googlegroups.com>.> an email to prometheus-devel...@googlegroups.com
> To post to this group, send email to
> prometheus...@googlegroups.com
> <mailto:prometheus...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/f6ea9174-8145-75f5-fa5c-f07a52e74eb5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLpXM3s8fk0wo-21C6NXEaeGKJR8ZBUkRfGWfA8%3DXdBiPg%40mail.gmail.com.
I still have to look at the code, but I will say that generating and using an API client based on an schema/api spec (my experience was with a go backend + protobuf definition with an elm frontend) was a real pleasure.Is the legacy alert ingestion endpoint for a very old version of prometheus? If it's pre prometheus v1, I would be in favor of removing it.
A question: Do we want to deprecate the v1 api, or are we ok with just formalizing it with an openapi spec?
stuart
> <mailto:prometheus-developers+unsub...@googlegroups.com>.> an email to prometheus-developers+unsub...@googlegroups.com
> To post to this group, send email to
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/f6ea9174-8145-75f5-fa5c-f07a52e74eb5%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLpXM3s8fk0wo-21C6NXEaeGKJR8ZBUkRfGWfA8%3DXdBiPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
> Is the legacy alert ingestion endpoint for a very old version of prometheus? If it's pre prometheus v1, I would be in favor of removing it.
As far as I can tell we moved away from the legacy "/api/alerts"
endpoint to "/api/v1/alerts" since Prometheus v0.17.0 [1][2].
> A question: Do we want to deprecate the v1 api, or are we ok with just formalizing it with an openapi spec?
I have also looked into extending the current Alertmanager v1 API via
Go-Swagger annotations but found it to be very hacky. I would prefer
starting from scratch for v2 and then deprecating v1 eventually. This
also gives us the possibility to take care of some technical dept in v1.
What do you think?
[1]
https://github.com/prometheus/prometheus/blob/master/notifier/notifier.go#L46
[2]
https://github.com/prometheus/prometheus/commit/e114ce0ff7a1ae06b24fdc479ffc7422074c1ebe
On 03.05.2018 08:18, Brian Brazil wrote:
> On 2 May 2018 at 22:40, Stuart Nelson <stuart...@gmail.com
> <mailto:stuartnelson3@gmail.com>> wrote:
>
> I still have to look at the code, but I will say that generating and
> using an API client based on an schema/api spec (my experience was
> with a go backend + protobuf definition with an elm frontend) was a
> real pleasure.
>
> Is the legacy alert ingestion endpoint for a very old version of
> prometheus? If it's pre prometheus v1, I would be in favor of
> removing it.
>
>
> Its for the current version of Prometheus.
>
>
> A question: Do we want to deprecate the v1 api, or are we ok with
> just formalizing it with an openapi spec?
>
>
>
> My question would be how would this work for Prometheus, as anything we
> do for the API in one place we're going to do in the other.
>
> Brian
>
>
>
> stuart
>
> On Tue, May 1, 2018 at 4:09 PM Brian Brazil
> > To post to this group, send email to
> > prometheus-developers@googlegroups.com
> <mailto:prometheus-developers@googlegroups.com>
> > <mailto:prometheus-developers@googlegroups.com
> <mailto:prometheus-developers@googlegroups.com>>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com>
> >
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the
> Google Groups "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
> To post to this group, send email to
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/f6ea9174-8145-75f5-fa5c-f07a52e74eb5%40gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/f6ea9174-8145-75f5-fa5c-f07a52e74eb5%40gmail.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Brian Brazil
> www.robustperception.io <http://www.robustperception.io>
>
> --
> You received this message because you are subscribed to the
> Google Groups "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
> To post to this group, send email to
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLpXM3s8fk0wo-21C6NXEaeGKJR8ZBUkRfGWfA8%3DXdBiPg%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLpXM3s8fk0wo-21C6NXEaeGKJR8ZBUkRfGWfA8%3DXdBiPg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Brian Brazil
> www.robustperception.io <http://www.robustperception.io>
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/f9034515-25fb-bb54-7877-4c5e816e6658%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
On 3 May 2018 at 08:35, Max Leonard Inden <ind...@gmail.com> wrote:> Is the legacy alert ingestion endpoint for a very old version of prometheus? If it's pre prometheus v1, I would be in favor of removing it.
As far as I can tell we moved away from the legacy "/api/alerts"
endpoint to "/api/v1/alerts" since Prometheus v0.17.0 [1][2].Ah, that we can kill then. The deprecation period for that has long passed.
> A question: Do we want to deprecate the v1 api, or are we ok with just formalizing it with an openapi spec?
I have also looked into extending the current Alertmanager v1 API via
Go-Swagger annotations but found it to be very hacky. I would prefer
starting from scratch for v2 and then deprecating v1 eventually. This
also gives us the possibility to take care of some technical dept in v1.
What do you think?That seems sane to me, as long as alert ingestion keeps working.Brian
[1]
https://github.com/prometheus/prometheus/blob/master/notifier/notifier.go#L46
[2]
https://github.com/prometheus/prometheus/commit/e114ce0ff7a1ae06b24fdc479ffc7422074c1ebe
On 03.05.2018 08:18, Brian Brazil wrote:
> On 2 May 2018 at 22:40, Stuart Nelson <stuart...@gmail.com
> <mailto:stuart...@gmail.com>> wrote:
>
> I still have to look at the code, but I will say that generating and
> using an API client based on an schema/api spec (my experience was
> with a go backend + protobuf definition with an elm frontend) was a
> real pleasure.
>
> Is the legacy alert ingestion endpoint for a very old version of
> prometheus? If it's pre prometheus v1, I would be in favor of
> removing it.
>
>
> Its for the current version of Prometheus.
>
>
> A question: Do we want to deprecate the v1 api, or are we ok with
> just formalizing it with an openapi spec?
>
>
>
> My question would be how would this work for Prometheus, as anything we
> do for the API in one place we're going to do in the other.
>
> Brian
>
>
>
> stuart
>
> On Tue, May 1, 2018 at 4:09 PM Brian Brazil
> > To post to this group, send email to
> > prometheus...@googlegroups.com
> <mailto:prometheus...@googlegroups.com>
> > <mailto:prometheus...@googlegroups.com
> <mailto:prometheus...@googlegroups.com>>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com>
> >
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/prometheus-developers/0b9527c6-79de-4063-af21-bb00dc577b6f%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the
> Google Groups "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
> To post to this group, send email to
> prometheus...@googlegroups.com
> <mailto:prometheus...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/f6ea9174-8145-75f5-fa5c-f07a52e74eb5%40gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/f6ea9174-8145-75f5-fa5c-f07a52e74eb5%40gmail.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Brian Brazil
> www.robustperception.io <http://www.robustperception.io>
>
> --
> You received this message because you are subscribed to the
> Google Groups "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
> To post to this group, send email to
> prometheus...@googlegroups.com
> <mailto:prometheus...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLpXM3s8fk0wo-21C6NXEaeGKJR8ZBUkRfGWfA8%3DXdBiPg%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLpXM3s8fk0wo-21C6NXEaeGKJR8ZBUkRfGWfA8%3DXdBiPg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Brian Brazil
> www.robustperception.io <http://www.robustperception.io>
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/f9034515-25fb-bb54-7877-4c5e816e6658%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLqhF5cGK2DK4H__wL_1Zj6TWWzkCdnr6q9ZiMRb3jfi0w%40mail.gmail.com.
Krasi Georgiev | |
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAPDv2HewfSRx8s8_%2B3tuYHDd2Ho5t6z5u%2BmYVoiz04FY_Uw5CA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com.
> You said that you attempted to port the existing API using annotations and it wasn't terribly clean. Would it be possible to model the existing v1 API (provided that we're happy with it) with OpenAPI? The question may be silly but I don't have any concrete experience with Swagger/OpenAPI.
Replacing the current API (v1) with an interface-identical OpenAPI
implementation will be difficult. I am not sure this would result in a
clean design while keeping all the specialities of the current v1.
> <mailto:prometheus-developers%2Bunsu...@googlegroups.com>.> send an email to prometheus-developers+unsub...@googlegroups.com
> To post to this group, send email to
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/0ea16e13-99a6-4f4c-20de-74944cf6a053%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Replacing the current API (v1) with an interface-identical OpenAPI
implementation will be difficult. I am not sure this would result in a
clean design while keeping all the specialities of the current v1.
> <mailto:prometheus-developers%2Bunsubscribe@googlegroups.com>.> send an email to prometheus-developers+unsubscri...@googlegroups.com
> To post to this group, send email to
> prometheus-developers@googlegroups.com
> <mailto:prometheus-devel...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsubscri...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/0ea16e13-99a6-4f4c-20de-74944cf6a053%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLq_EasnYThBOmL4cocdaYJ6PGAQt--3i22eHW2-iww%2Bvg%40mail.gmail.com.
> Even if we allow differences in error handling?
Allowing differences in error handling sounds like a breaking change to
me. Thereby I would prefer to bump the API version to v2, instead of
changing the API v1 behaviour. What do you think Brian?
> > To post to this group, send email to
> > prometheus-developers@googlegroups.com
> <mailto:prometheus-developers@googlegroups.com>
> > <mailto:prometheus-devel...@googlegroups.com
> <mailto:prometheus-developers@googlegroups.com>>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com>
> >
> <https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/59f721ce-d41a-4051-fc00-1eeaa1c99213%40gmail.com>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> >
>
> --
> You received this message because you are subscribed to the
> Google Groups "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to
> <mailto:prometheus-developers%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/0ea16e13-99a6-4f4c-20de-74944cf6a053%40gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/0ea16e13-99a6-4f4c-20de-74944cf6a053%40gmail.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Brian Brazil
> www.robustperception.io <http://www.robustperception.io>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to prometheus-developers+unsub...@googlegroups.com
> <mailto:prometheus-developers+unsub...@googlegroups.com>.
> To post to this group, send email to
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLq_EasnYThBOmL4cocdaYJ6PGAQt--3i22eHW2-iww%2Bvg%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/CAHJKeLq_EasnYThBOmL4cocdaYJ6PGAQt--3i22eHW2-iww%2Bvg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>