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

InfluxDB: annotations migration to backend #45635

Merged
merged 12 commits into from
Mar 23, 2022
Merged

Conversation

joey-grafana
Copy link
Contributor

@joey-grafana joey-grafana commented Feb 19, 2022

What this PR does / why we need it:
Part of #43076

This PR contains the changes needed to migrate annotations to the backend.

Test scenarios:

  1. Run make devenv sources=influxdb,influxdb1,grafana grafana_version=8.2.4 (or other version before changes)
  2. Open up http://localhost:3000 && http://127.0.0.1:3001 (to test older 8.2.4 version)
  3. Select gdev-influxdb-influxql
    • create a dashboard
    • create an annotation query in your dashboard e.g. select * from logs where time >= now() - 30m and time <= now() (be careful with the - 30m above as setting a value too big will potentially return tens of thousands of results. Maybe a smaller time like - 10m to start and increment until you get a number of results you are happy with)
    • add a time series panel hooked up to influxdb
    • set time range to last 3 hours or so (at least enough to cover time range set on annotation query)
    • go back to your dashboard and toggle on the annotation query -> you should see annotations in your dashboard
    • go back to your panel in edit mode -> you should see annotations
  4. Select gdev-influxdb1-influxql
    • Should behave like gdev-influxdb-influxql

PS: make sure
[feature_toggles]
enable = influxdbBackendMigration

@joey-grafana joey-grafana requested review from a team and removed request for a team March 1, 2022 15:32
title: value[titleCol],
timeEnd: value[timeEndCol],
// Remove empty values, then split in different tags for comma separated values
tags: flatten(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Field mapping doesn't seems to work correctly after migration. Example For the query SELECT time,host,message,path from logs where time >= now() - 30m and time <= now(), the tags are not working as expected after migration.

Query:

image

Before migration:

image

After migration:

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there are chances that user have multiple fields as tags.

image

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2022-03-17 at 12 06 04

annotation: {
name: 'Anno',
query: 'select * from logs where time >= now() - 15m and time <= now()',
textColumn: 'textColumn',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add tests for field migration as well? especially for tags?

Copy link
Contributor

@yesoreyeram yesoreyeram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joey-grafana joey-grafana merged commit aabafee into main Mar 23, 2022
@joey-grafana joey-grafana deleted the joey/influxdb_annotations branch March 23, 2022 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants