Creating an XY Bubble chart by joining two series

  • What Grafana version and what operating system are you using?

    • v12.1.1 and MacOS
  • What are you trying to achieve?

    • Create an XY Bubble chart where: X axis is time, Y axis is operation latency, and the bubble size is the operation count
    • We have separate series for operation latency (last_exec_micros ) and operation count (exec_count_total) that should have aligning timestamps and labels (they come from the same ping)
  • How are you trying to achieve it?

    • Added the two queries (see JSON below)
    • Apply “Join by field” with a field that is not time to create a single table (but I see duplicate “Time” columns)
  • What happened?

    • When I select the X (time) / Y (last_exec_micro) / Size (exec_count_total) field, I just see an “Err” text in the chart
    • I suspect it’s because I’m not merging the tables on the “Time” field
  • What did you expect to happen?

    • A bubble chart with the expected axes to be generated
  • Can you copy/paste the configuration(s) that you are having problems with?

{
      "datasource": {
        "type": "victoriametrics-metrics-datasource",
        "uid": "${data_source}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "fillOpacity": 50,
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "pointShape": "circle",
            "pointSize": {
              "fixed": 27
            },
            "pointStrokeWidth": 1,
            "scaleDistribution": {
              "type": "linear"
            },
            "show": "points"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": 0
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "__systemRef": "hideSeriesFrom",
            "matcher": {
              "id": "byNames",
              "options": {
                "mode": "exclude",
                "names": [
                  "Latency"
                ],
                "prefix": "All except:",
                "readOnly": true
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": false,
                  "tooltip": false,
                  "viz": true
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 101
      },
      "id": 35,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "mapping": "manual",
        "series": [
          {
            "frame": {
              "matcher": {
                "id": "byIndex",
                "options": 0
              }
            },
            "size": {
              "matcher": {
                "id": "byName",
                "options": "Operation Count"
              }
            },
            "x": {
              "matcher": {
                "id": "byName",
                "options": "Time 1"
              }
            },
            "y": {
              "matcher": {
                "id": "byName",
                "options": "Latency"
              }
            }
          }
        ],
        "tooltip": {
          "hideZeros": false,
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "12.1.1",
      "targets": [
        {
          "datasource": {
            "type": "victoriametrics-metrics-datasource",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(last_exec_micros{process_hostname=~\"($hostname)\"}) by (namespace, hash)",
          "format": "table",
          "instant": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "victoriametrics-metrics-datasource",
            "uid": "${data_source}"
          },
          "editorMode": "code",
          "expr": "sum(rate(exec_count_total{process_hostname=~\"($hostname)\"})) by (hash)",
          "format": "table",
          "hide": false,
          "legendFormat": "__auto",
          "range": true,
          "refId": "B"
        }
      ],
      "title": "Latency Over Time",
      "transformations": [
        {
          "id": "joinByField",
          "options": {
            "byField": "hash",
            "mode": "outer"
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time 1": false,
              "Time 2": true
            },
            "includeByName": {},
            "indexByName": {
              "Time 1": 0,
              "Time 2": 5,
              "Value #A": 3,
              "Value #B": 4,
              "namespace": 1,
              "hash": 2
            },
            "renameByName": {
              "Time 1": "",
              "Time 2": "",
              "Value #A": "Latency",
              "Value #B": "Operation Count",
              "namespace": "Namespace",
              "hash": "Hash",
              "hash 1": "Hash"
            }
          }
        }
      ],
      "type": "xychart"
    }
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

    • Don’t think I see any relevant errors
  • Did you follow any online instructions? If so, what is the URL?

    • No