1. Packages
  2. Honeycombio Provider
  3. API Docs
  4. QueryAnnotation
honeycombio 0.32.0 published on Monday, Apr 7, 2025 by honeycombio

honeycombio.QueryAnnotation

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";

const config = new pulumi.Config();
const dataset = config.require("dataset");
const testQueryQuerySpecification = honeycombio.getQuerySpecification({
    calculations: [{
        op: "AVG",
        column: "duration_ms",
    }],
    filters: [{
        column: "duration_ms",
        op: ">",
        value: "10",
    }],
});
const testQueryQuery = new honeycombio.Query("testQueryQuery", {
    dataset: dataset,
    queryJson: testQueryQuerySpecification.then(testQueryQuerySpecification => testQueryQuerySpecification.json),
});
const testAnnotation = new honeycombio.QueryAnnotation("testAnnotation", {
    dataset: dataset,
    queryId: testQueryQuery.id,
    description: "Describes my cool query (optional)",
});
Copy
import pulumi
import pulumi_honeycombio as honeycombio

config = pulumi.Config()
dataset = config.require("dataset")
test_query_query_specification = honeycombio.get_query_specification(calculations=[{
        "op": "AVG",
        "column": "duration_ms",
    }],
    filters=[{
        "column": "duration_ms",
        "op": ">",
        "value": "10",
    }])
test_query_query = honeycombio.Query("testQueryQuery",
    dataset=dataset,
    query_json=test_query_query_specification.json)
test_annotation = honeycombio.QueryAnnotation("testAnnotation",
    dataset=dataset,
    query_id=test_query_query.id,
    description="Describes my cool query (optional)")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/honeycombio/honeycombio"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		dataset := cfg.Require("dataset")
		testQueryQuerySpecification, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
			Calculations: []honeycombio.GetQuerySpecificationCalculation{
				{
					Op:     "AVG",
					Column: pulumi.StringRef("duration_ms"),
				},
			},
			Filters: []honeycombio.GetQuerySpecificationFilter{
				{
					Column: "duration_ms",
					Op:     ">",
					Value:  pulumi.StringRef("10"),
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		testQueryQuery, err := honeycombio.NewQuery(ctx, "testQueryQuery", &honeycombio.QueryArgs{
			Dataset:   pulumi.String(dataset),
			QueryJson: pulumi.String(testQueryQuerySpecification.Json),
		})
		if err != nil {
			return err
		}
		_, err = honeycombio.NewQueryAnnotation(ctx, "testAnnotation", &honeycombio.QueryAnnotationArgs{
			Dataset:     pulumi.String(dataset),
			QueryId:     testQueryQuery.ID(),
			Description: pulumi.String("Describes my cool query (optional)"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Honeycombio = Pulumi.Honeycombio;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var dataset = config.Require("dataset");
    var testQueryQuerySpecification = Honeycombio.GetQuerySpecification.Invoke(new()
    {
        Calculations = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
            {
                Op = "AVG",
                Column = "duration_ms",
            },
        },
        Filters = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationFilterInputArgs
            {
                Column = "duration_ms",
                Op = ">",
                Value = "10",
            },
        },
    });

    var testQueryQuery = new Honeycombio.Query("testQueryQuery", new()
    {
        Dataset = dataset,
        QueryJson = testQueryQuerySpecification.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
    });

    var testAnnotation = new Honeycombio.QueryAnnotation("testAnnotation", new()
    {
        Dataset = dataset,
        QueryId = testQueryQuery.Id,
        Description = "Describes my cool query (optional)",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.honeycombio.HoneycombioFunctions;
import com.pulumi.honeycombio.inputs.GetQuerySpecificationArgs;
import com.pulumi.honeycombio.Query;
import com.pulumi.honeycombio.QueryArgs;
import com.pulumi.honeycombio.QueryAnnotation;
import com.pulumi.honeycombio.QueryAnnotationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var config = ctx.config();
        final var dataset = config.get("dataset");
        final var testQueryQuerySpecification = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
            .calculations(GetQuerySpecificationCalculationArgs.builder()
                .op("AVG")
                .column("duration_ms")
                .build())
            .filters(GetQuerySpecificationFilterArgs.builder()
                .column("duration_ms")
                .op(">")
                .value(10)
                .build())
            .build());

        var testQueryQuery = new Query("testQueryQuery", QueryArgs.builder()
            .dataset(dataset)
            .queryJson(testQueryQuerySpecification.applyValue(getQuerySpecificationResult -> getQuerySpecificationResult.json()))
            .build());

        var testAnnotation = new QueryAnnotation("testAnnotation", QueryAnnotationArgs.builder()
            .dataset(dataset)
            .queryId(testQueryQuery.id())
            .description("Describes my cool query (optional)")
            .build());

    }
}
Copy
configuration:
  dataset:
    type: string
resources:
  testQueryQuery:
    type: honeycombio:Query
    properties:
      dataset: ${dataset}
      queryJson: ${testQueryQuerySpecification.json}
  testAnnotation:
    type: honeycombio:QueryAnnotation
    properties:
      dataset: ${dataset}
      queryId: ${testQueryQuery.id}
      description: Describes my cool query (optional)
variables:
  testQueryQuerySpecification:
    fn::invoke:
      function: honeycombio:getQuerySpecification
      arguments:
        calculations:
          - op: AVG
            column: duration_ms
        filters:
          - column: duration_ms
            op: '>'
            value: 10
Copy

Create QueryAnnotation Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new QueryAnnotation(name: string, args: QueryAnnotationArgs, opts?: CustomResourceOptions);
@overload
def QueryAnnotation(resource_name: str,
                    args: QueryAnnotationArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def QueryAnnotation(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    query_id: Optional[str] = None,
                    dataset: Optional[str] = None,
                    description: Optional[str] = None,
                    name: Optional[str] = None,
                    query_annotation_id: Optional[str] = None)
func NewQueryAnnotation(ctx *Context, name string, args QueryAnnotationArgs, opts ...ResourceOption) (*QueryAnnotation, error)
public QueryAnnotation(string name, QueryAnnotationArgs args, CustomResourceOptions? opts = null)
public QueryAnnotation(String name, QueryAnnotationArgs args)
public QueryAnnotation(String name, QueryAnnotationArgs args, CustomResourceOptions options)
type: honeycombio:QueryAnnotation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. QueryAnnotationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. QueryAnnotationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. QueryAnnotationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. QueryAnnotationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. QueryAnnotationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var queryAnnotationResource = new Honeycombio.QueryAnnotation("queryAnnotationResource", new()
{
    QueryId = "string",
    Dataset = "string",
    Description = "string",
    Name = "string",
    QueryAnnotationId = "string",
});
Copy
example, err := honeycombio.NewQueryAnnotation(ctx, "queryAnnotationResource", &honeycombio.QueryAnnotationArgs{
QueryId: pulumi.String("string"),
Dataset: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
QueryAnnotationId: pulumi.String("string"),
})
Copy
var queryAnnotationResource = new QueryAnnotation("queryAnnotationResource", QueryAnnotationArgs.builder()
    .queryId("string")
    .dataset("string")
    .description("string")
    .name("string")
    .queryAnnotationId("string")
    .build());
Copy
query_annotation_resource = honeycombio.QueryAnnotation("queryAnnotationResource",
    query_id="string",
    dataset="string",
    description="string",
    name="string",
    query_annotation_id="string")
Copy
const queryAnnotationResource = new honeycombio.QueryAnnotation("queryAnnotationResource", {
    queryId: "string",
    dataset: "string",
    description: "string",
    name: "string",
    queryAnnotationId: "string",
});
Copy
type: honeycombio:QueryAnnotation
properties:
    dataset: string
    description: string
    name: string
    queryAnnotationId: string
    queryId: string
Copy

QueryAnnotation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The QueryAnnotation resource accepts the following input properties:

QueryId This property is required. string
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
Dataset string
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
Description string
The description to display as the query annotation.
Name string
The name to display as the query annotation.
QueryAnnotationId string
ID of the query annotation. Useful for adding it to a board.
QueryId This property is required. string
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
Dataset string
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
Description string
The description to display as the query annotation.
Name string
The name to display as the query annotation.
QueryAnnotationId string
ID of the query annotation. Useful for adding it to a board.
queryId This property is required. String
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset String
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description String
The description to display as the query annotation.
name String
The name to display as the query annotation.
queryAnnotationId String
ID of the query annotation. Useful for adding it to a board.
queryId This property is required. string
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset string
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description string
The description to display as the query annotation.
name string
The name to display as the query annotation.
queryAnnotationId string
ID of the query annotation. Useful for adding it to a board.
query_id This property is required. str
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset str
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description str
The description to display as the query annotation.
name str
The name to display as the query annotation.
query_annotation_id str
ID of the query annotation. Useful for adding it to a board.
queryId This property is required. String
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset String
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description String
The description to display as the query annotation.
name String
The name to display as the query annotation.
queryAnnotationId String
ID of the query annotation. Useful for adding it to a board.

Outputs

All input properties are implicitly available as output properties. Additionally, the QueryAnnotation resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing QueryAnnotation Resource

Get an existing QueryAnnotation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: QueryAnnotationState, opts?: CustomResourceOptions): QueryAnnotation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dataset: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        query_annotation_id: Optional[str] = None,
        query_id: Optional[str] = None) -> QueryAnnotation
func GetQueryAnnotation(ctx *Context, name string, id IDInput, state *QueryAnnotationState, opts ...ResourceOption) (*QueryAnnotation, error)
public static QueryAnnotation Get(string name, Input<string> id, QueryAnnotationState? state, CustomResourceOptions? opts = null)
public static QueryAnnotation get(String name, Output<String> id, QueryAnnotationState state, CustomResourceOptions options)
resources:  _:    type: honeycombio:QueryAnnotation    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Dataset string
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
Description string
The description to display as the query annotation.
Name string
The name to display as the query annotation.
QueryAnnotationId string
ID of the query annotation. Useful for adding it to a board.
QueryId string
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
Dataset string
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
Description string
The description to display as the query annotation.
Name string
The name to display as the query annotation.
QueryAnnotationId string
ID of the query annotation. Useful for adding it to a board.
QueryId string
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset String
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description String
The description to display as the query annotation.
name String
The name to display as the query annotation.
queryAnnotationId String
ID of the query annotation. Useful for adding it to a board.
queryId String
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset string
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description string
The description to display as the query annotation.
name string
The name to display as the query annotation.
queryAnnotationId string
ID of the query annotation. Useful for adding it to a board.
queryId string
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset str
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description str
The description to display as the query annotation.
name str
The name to display as the query annotation.
query_annotation_id str
ID of the query annotation. Useful for adding it to a board.
query_id str
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.
dataset String
The dataset this query annotation is added to. If not set, an Environment-wide query annotation will be created.
description String
The description to display as the query annotation.
name String
The name to display as the query annotation.
queryAnnotationId String
ID of the query annotation. Useful for adding it to a board.
queryId String
The ID of the query that the annotation will be created on. Note that a query can have more than one annotation.

Import

Query annotations cannot be imported.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
honeycombio honeycombio/terraform-provider-honeycombio
License
Notes
This Pulumi package is based on the honeycombio Terraform Provider.