Hi David Karlsen, How did you end up setting this requirement? I am trying to set the same so that the alerts can be routed to teams by OpsGenie through tags or labels (trying to find the best way to achieve this). Any tips will be helpful.
Thanks Vikram On Sunday, April 2, 2017 at 7:12:47 AM UTC-5, Julius Volz wrote: > > Yeah, you can currently specify the Details field in the config, but you > have to manually list each key/value pair there. > > On Sun, Apr 2, 2017 at 1:41 PM, David Karlsen <[email protected] > <javascript:>> wrote: > >> Will do. I actually see a details element in the opsgenie config on the >> alertmanager side of things so I'll play around a bit with that and come >> back with a proposal. >> >> Thanks again. >> >> >> Den søn. 2. apr. 2017, 13:37 skrev Julius Volz <[email protected] >> <javascript:>>: >> >>> Good point - maybe that should even be the default behavior. Enabling >>> something like this at least would make sense to me. >>> >>> Care to file an issue (of course, feel free to submit a PR as well)? >>> >>> On Sun, Apr 2, 2017 at 11:24 AM, David Karlsen <[email protected] >>> <javascript:>> wrote: >>> >>>> Great - thanks a lot. >>>> Actually there is a "details" element in opsgenie which fits labels >>>> like a glove as it's key/value based: >>>> https://www.opsgenie.com/docs/web-api/alert-api#createAlertRequest - >>>> maybe there could be an option for opsgenie integration >>>> "mapLabelsToDetails" to propagate them over here. >>>> It has more space (8k) vs tags which is max 20, each max 50 chars >>>> >>>> 2017-04-01 22:43 GMT+02:00 Julius Volz <[email protected] >>>> <javascript:>>: >>>> >>>>> Try something like this (same for annotations): >>>>> >>>>> {{ range $k, $v := .CommonLabels}}{{$k}}={{$v}},{{end}} >>>>> >>>>> Note that you'll have a comma after the last element as well this way, >>>>> plus it won't escape commas in label values for you. >>>>> >>>>> Also, OpsGenie won't know about the k=v structure (because they just >>>>> use single-string tags), but maybe it'll be helpful anyways. >>>>> >>>>> On Sat, Apr 1, 2017 at 6:07 PM, David Karlsen <[email protected] >>>>> <javascript:>> wrote: >>>>> >>>>>> I tried adding tags: myStaticTag,{{.CommonAnnotations}} to the >>>>>> opsgenie config section of alertmanager - but tags get truncated >>>>>> >>>>>> [d1, map[label1:labelvalue1 label2:someValueButGetItWillBeTruncated >>>>>> >>>>>> so it seems to get truncated (the actual values are anonymized) >>>>>> >>>>>> 2017-04-01 12:20 GMT+02:00 David Karlsen <[email protected] >>>>>> <javascript:>>: >>>>>> >>>>>>> I think I'd like key=value - so that it's semantially richer in the >>>>>>> opsgenie UI and also more informational for the one receiving the alert. >>>>>>> >>>>>>> 2017-04-01 0:14 GMT+02:00 Julius Volz <[email protected] >>>>>>> <javascript:>>: >>>>>>> >>>>>>>> The "tags" field of the OpsGenie notification config is >>>>>>>> templateable and has access to the alert metadata, so this should be >>>>>>>> possible. OpsGenie tags are simple strings, not key=value pairs >>>>>>>> though. Or >>>>>>>> do you want to encode the k=v pair into a single string for each alert >>>>>>>> label? Also note that a notification can contain multiple alerts with >>>>>>>> different labels, so only the .CommonLabels and .CommonAnnotations >>>>>>>> should >>>>>>>> be used for this in the template. >>>>>>>> >>>>>>>> On Sat, Apr 1, 2017 at 12:05 AM, David Karlsen < >>>>>>>> [email protected] <javascript:>> wrote: >>>>>>>> >>>>>>>>> Hi. >>>>>>>>> >>>>>>>>> Is it possible to map all labels (which may be unknown in advance >>>>>>>>> - I want to map all of them generically) over to opsgenie tags? >>>>>>>>> That way we can easily let teams route alerts in opsgenie based on >>>>>>>>> whatever labels they have defined. >>>>>>>>> >>>>>>>>> TIA, >>>>>>>>> David >>>>>>>>> >>>>>>>>> -- >>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>> Groups "Prometheus Users" group. >>>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>>> send an email to [email protected] <javascript:>. >>>>>>>>> To post to this group, send email to [email protected] >>>>>>>>> <javascript:>. >>>>>>>>> To view this discussion on the web visit >>>>>>>>> https://groups.google.com/d/msgid/prometheus-users/55f4992b-9d15-490d-aa27-f2e2d7071f65%40googlegroups.com >>>>>>>>> >>>>>>>>> <https://groups.google.com/d/msgid/prometheus-users/55f4992b-9d15-490d-aa27-f2e2d7071f65%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 Users" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to [email protected] <javascript:>. >>>>>>>> To post to this group, send email to [email protected] >>>>>>>> <javascript:>. >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/prometheus-users/CA%2BT6Yoz6MLPR0WGYOsXPgucRO_th5MkqehLf44mf%2BAMLjvkQyw%40mail.gmail.com >>>>>>>> >>>>>>>> <https://groups.google.com/d/msgid/prometheus-users/CA%2BT6Yoz6MLPR0WGYOsXPgucRO_th5MkqehLf44mf%2BAMLjvkQyw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>>>>> . >>>>>>>> >>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> -- >>>>>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> -- >>>>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen >>>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Prometheus Users" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected] <javascript:>. >>>>> To post to this group, send email to [email protected] >>>>> <javascript:>. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/prometheus-users/CA%2BT6YoyLufCKN%3Dbun%2Bu5v0hbkSTP%2BjcLZ8Fmkfz3oESrCct8Gw%40mail.gmail.com >>>>> >>>>> <https://groups.google.com/d/msgid/prometheus-users/CA%2BT6YoyLufCKN%3Dbun%2Bu5v0hbkSTP%2BjcLZ8Fmkfz3oESrCct8Gw%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> >>>> -- >>>> -- >>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Prometheus Users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected] <javascript:>. >>>> To post to this group, send email to [email protected] >>>> <javascript:>. >>>> >>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/prometheus-users/CAGO7Ob3KNAQtVyKTFY7d24Dc3r8GLPQCNGFSqX8NpKttaRutmw%40mail.gmail.com >>>> >>>> <https://groups.google.com/d/msgid/prometheus-users/CAGO7Ob3KNAQtVyKTFY7d24Dc3r8GLPQCNGFSqX8NpKttaRutmw%40mail.gmail.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 Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/prometheus-users/CAGO7Ob18THQk_ikkF_3y0KFxOpVZMshqw_sHywpyJKjtBvBuKA%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/prometheus-users/CAGO7Ob18THQk_ikkF_3y0KFxOpVZMshqw_sHywpyJKjtBvBuKA%40mail.gmail.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 Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/1beead53-97ad-4197-aee7-e193217dae25%40googlegroups.com.

