This guide helps developers familiar with Axiom's APL (Axiom Processing Language) translate their queries to ClickHouse SQL for Grafana.
| Axiom Dataset | ClickHouse Table |
|---|---|
['core-production'] |
otel.otel_logs_v1 |
['core-tracing'] |
otel.otel_traces_v2 |
This guide helps developers familiar with Axiom's APL (Axiom Processing Language) translate their queries to ClickHouse SQL for Grafana.
| Axiom Dataset | ClickHouse Table |
|---|---|
['core-production'] |
otel.otel_logs_v1 |
['core-tracing'] |
otel.otel_traces_v2 |
Gelly has seen some significant developments over the last few months. Some of the changes were breaking but have been rolled out with caution and deployed for some time.
There have been large structural changes in the SQL generated from Gelly queries. Broadly it means fewer sub-selects and more joins. This allows some performance improvements, but primarily enables addressing a number of previous limitations listed below.
| /** | |
| INSTRUCTIONS | |
| This gist relates to the Gadget quickstart, available here - https://docs.gadget.dev/guides/getting-started/quickstart | |
| - get an OpenAI API key (https://openai.com/) | |
| - add the key as an OPENAI_API_KEY Environment Variable in your Gadget app (Settings -> Environment Variables) | |
| - install the 'openai' npm package (open Gadget command palette, type '>' to enter command mode, enter 'yarn add openai') | |
| - paste the following snippet into the code file that runs on the Gadgemon's create action (gadgemon/create/onCreateSuccess.js) | |
| */ |
| // input.graphql file for a Shopify product discount Function | |
| query Input { | |
| cart { | |
| attribute(key: "addedPrePurchase") { | |
| value | |
| } | |
| lines { | |
| quantity | |
| merchandise { |
| const { Configuration, OpenAIApi } = require("openai"); | |
| /** | |
| * Effect code for update on Shopify Product | |
| * @param { import("gadget-server").UpdateShopifyProductActionContext } context - Everything for running this effect, like the api client, current record, params, etc. More on effect context: https://docs.gadget.dev/guides/extending-with-code#effect-context | |
| */ | |
| module.exports = async ({ api, record, params, logger, connections }) => { | |
| const configuration = new Configuration({ | |
| apiKey: process.env.OPENAI_API_KEY, | |
| }); |
| <link rel="stylesheet" href="{{ 'section-main-page.css' | asset_url }}" media="print" onload="this.media='all'"> | |
| <link rel="stylesheet" href="{{ 'component-rte.css' | asset_url }}" media="print" onload="this.media='all'"> | |
| <!-- Find your direct script tag in the Installing section in your Gadget project's API Reference --> | |
| <script src="YOUR DIRECT SCRIPT TAG HERE"></script> | |
| <script src="{{ 'product-quiz.js' | asset_url }}" defer="defer"></script> | |
| <noscript>{{ 'section-main-page.css' | asset_url | stylesheet_tag }}</noscript> | |
| <noscript>{{ 'component-rte.css' | asset_url | stylesheet_tag }}</noscript> | |
| <div class="page-width page-width--narrow"> | |
| <product-quiz class="quiz"> |
| /** | |
| * Fetch the ids for metafields on a resource | |
| */ | |
| const fetchMetafieldIds = async ({ resource, shopifyApi, metafieldSchema, id }) => { | |
| const gidResource = resource.charAt(0).toUpperCase() + resource.slice(1); | |
| const gid = `gid://shopify/${gidResource}/${id}`; | |
| return ( | |
| await shopifyApi.graphql( | |
| ` | |
| query MetafieldIds($id: ID!) { |