Annotation Query, select multiple fields as tags

Howdy,

I am new to the annotation queries but understand that the main fields are event, event stop, text, and tags.

I am querying a ms sql database for event data to display as annotations in grafana. My query works as expected but I am only able to select one field as the tags type. When I attempt to select two fields as the tag type the query crashes as a 400 error.

My query below works as expected but I would really appreciate if someone had syntax or a method for selecting more than one column to produce more the than one tag

SELECT
m.event_start as time,
m.event as text,
m.siteid as tags

I have tried (), , {}, AND, &, and nothing has worked so far.

Hi @reisenrich1,

Welcome to the :grafana: community support forums !!

We are excited that you joined our OSS community. Please read about some of the FAQs in the community :slight_smile:

Did you already check the documentation regarding it i.e.

It should be possible to select 2 tags. For e.g. I use a test case and I was able to create multiple tags which got saved.

Also found more examples in the Documentation for Annotations (it is for MySQL but should be compatible with MSSQL) where you have to define the Annotation Query via Dashboard => Settings => Annotation => Select the MSSQL Datasource and define the query:

Let us know if this helps.

Hi @usman.ahmad
Could you please provide the syntax/query that you used to populate the annotations with multiple tags?
I think that is the answer @reisenrich1 (and myself) is looking for.

1 Like

I would love to see the example!

Found some examples from the Docs and also from an older post (but with a good explanation).

If this still does not work then let me know (especially via the Docs), I will then have to create a test machine and dig out further.

Looking forward to hear your feedbacks :slight_smile:

I am using influxdb as data source with grafana 10, and I can confirm that simple and range annotations with flux queries works as expected! What a great feature!