From 4823ef2b06634e0e4ad150c2016a059496d2810e Mon Sep 17 00:00:00 2001 From: Kwaw Date: Mon, 11 Dec 2023 21:24:18 +0000 Subject: [PATCH] Trace flyctl deploy path (#2986) * init tracing in flyctl deploy path * downgrade buildkit https://github.com/moby/buildkit/pull/4382 * instrument image resolving * export traces into jaegar for testing * authenticate all spans we send to honeycomb * better way to auth, i think * use dev & prod collectors accordingly * instrument all flaps calls * instrument all web calls * lowercase values and keys, remove tracing dependency * rip out duplicated tracing in flaps * attach user id to spana * linter wahala * use ctx to set request type * use snake case, address code review comments * pass original context * fix merge conflicts * attach trace context to http requests --- api/.golangci.yml | 4 +++ api/client.go | 51 +++++++++++++++++++++++++++ api/go.mod | 5 +++ api/go.sum | 14 +++++++- api/resource_activity.go | 1 + api/resource_allocs.go | 2 ++ api/resource_apps.go | 16 +++++++++ api/resource_certificates.go | 4 +++ api/resource_config.go | 3 ++ api/resource_deploy.go | 4 +++ api/resource_dns.go | 3 ++ api/resource_doctor.go | 1 + api/resource_domains.go | 14 ++++---- api/resource_health_check_handlers.go | 4 +++ api/resource_health_checks.go | 1 + api/resource_images.go | 4 ++- api/resource_ip_addresses.go | 8 +++-- api/resource_machines.go | 1 + api/resource_monitoring.go | 2 ++ api/resource_organizations.go | 14 ++++++-- api/resource_platform.go | 3 ++ api/resource_postgres.go | 8 +++++ api/resource_regions.go | 4 +++ api/resource_releases.go | 6 ++-- api/resource_remote_builders.go | 1 + api/resource_scale.go | 8 +++++ api/resource_secrets.go | 3 ++ api/resource_ssh.go | 3 ++ api/resource_tokens.go | 1 + api/resource_user.go | 2 ++ api/resource_vms.go | 2 ++ api/resource_volumes.go | 1 + api/resource_wireguard.go | 9 +++++ api/resources_migration.go | 2 ++ 34 files changed, 193 insertions(+), 16 deletions(-) diff --git a/api/.golangci.yml b/api/.golangci.yml index cdfc3db..fc9f6f9 100644 --- a/api/.golangci.yml +++ b/api/.golangci.yml @@ -49,6 +49,10 @@ linters-settings: - github.com/Khan/genqlient - github.com/PuerkitoBio/rehttp - github.com/superfly/graphql + - go.opentelemetry.io/otel + - go.opentelemetry.io/otel/attribute + - go.opentelemetry.io/otel/codes + - go.opentelemetry.io/otel/trace domains: - golang.org diff --git a/api/client.go b/api/client.go index 0145d44..47f07af 100644 --- a/api/client.go +++ b/api/client.go @@ -15,6 +15,10 @@ import ( genq "github.com/Khan/genqlient/graphql" "github.com/superfly/flyctl/api/tokens" "github.com/superfly/graphql" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" ) var ( @@ -24,6 +28,20 @@ var ( defaultTransport http.RoundTripper = http.DefaultTransport ) +var contextKeyAction = contextKey("gql_action") + +func ctxWithAction(ctx context.Context, action string) context.Context { + return context.WithValue(ctx, contextKeyAction, action) +} + +func actionFromCtx(ctx context.Context) string { + action := ctx.Value(contextKeyAction) + if action != nil { + return action.(string) + } + return "unknown_actiom" +} + // SetBaseURL - Sets the base URL for the API func SetBaseURL(url string) { baseURL = url @@ -139,8 +157,36 @@ func (c *Client) Run(req *graphql.Request) (Query, error) { func (c *Client) Logger() Logger { return c.logger } +func (c *Client) getRequestType(r *graphql.Request) string { + query := r.Query() + + if strings.Contains(query, "mutation") { + return "mutation" + } + + if strings.Contains(query, "query") { + return "query" + } + return "unknown" +} +func (c *Client) getErrorFromErrors(errors Errors) string { + errs := []string{} + for _, err := range errors { + errs = append(errs, err.Message) + } + + return strings.Join(errs, ",") +} + // RunWithContext - Runs a GraphQL request within a Go context func (c *Client) RunWithContext(ctx context.Context, req *graphql.Request) (Query, error) { + tracer := otel.GetTracerProvider().Tracer("github.com/superfly/flyctl/api") + ctx, span := tracer.Start(ctx, fmt.Sprintf("web.%s", actionFromCtx(ctx)), trace.WithAttributes( + attribute.String("request.action", actionFromCtx(ctx)), + attribute.String("request.type", c.getRequestType(req)), + )) + defer span.End() + if instrumenter != nil { start := time.Now() defer func() { @@ -151,6 +197,11 @@ func (c *Client) RunWithContext(ctx context.Context, req *graphql.Request) (Quer var resp Query err := c.client.Run(ctx, req, &resp) + if resp.Errors != nil { + span.RecordError(fmt.Errorf(c.getErrorFromErrors(resp.Errors))) + span.SetStatus(codes.Error, "failed to do grapqhl request") + } + if resp.Errors != nil && errorLog { fmt.Fprintf(os.Stderr, "Error: %+v\n", resp.Errors) } diff --git a/api/go.mod b/api/go.mod index 5b70c7f..a2897cc 100644 --- a/api/go.mod +++ b/api/go.mod @@ -6,12 +6,17 @@ require ( github.com/Khan/genqlient v0.6.0 github.com/PuerkitoBio/rehttp v1.3.0 github.com/superfly/graphql v0.2.4 + go.opentelemetry.io/otel v1.19.0 + go.opentelemetry.io/otel/trace v1.19.0 golang.org/x/crypto v0.16.0 ) require ( + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/vektah/gqlparser/v2 v2.5.1 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.15.0 // indirect ) diff --git a/api/go.sum b/api/go.sum index 021a215..2ab7347 100644 --- a/api/go.sum +++ b/api/go.sum @@ -13,6 +13,12 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -26,11 +32,17 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/superfly/graphql v0.2.4 h1:Av8hSk4x8WvKJ6MTnEwrLknSVSGPc7DWpgT3z/kt3PU= github.com/superfly/graphql v0.2.4/go.mod h1:CVfDl31srm8HnJ9udwLu6hFNUW/P6GUM2dKcG1YQ8jc= github.com/vektah/gqlparser/v2 v2.5.1 h1:ZGu+bquAY23jsxDRcYpWjttRZrUz07LbiY77gUOHcr4= github.com/vektah/gqlparser/v2 v2.5.1/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= diff --git a/api/resource_activity.go b/api/resource_activity.go index 2ab1a5f..1fb61ad 100644 --- a/api/resource_activity.go +++ b/api/resource_activity.go @@ -29,6 +29,7 @@ func (c *Client) GetAppChanges(ctx context.Context, appName string) ([]AppChange req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_changes") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_allocs.go b/api/resource_allocs.go index 8c24dad..504d846 100644 --- a/api/resource_allocs.go +++ b/api/resource_allocs.go @@ -38,6 +38,7 @@ func (c *Client) GetAllocations(ctx context.Context, appName string, showComplet req := c.NewRequest(query) req.Var("appName", appName) req.Var("showCompleted", showCompleted) + ctx = ctxWithAction(ctx, "get_allocations") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -62,6 +63,7 @@ func (c *Client) GetAllocationTaskNames(ctx context.Context, appName string) (ma req := c.NewRequest(query) req.Var("appName", appName) req.Var("showCompleted", false) + ctx = ctxWithAction(ctx, "get_allocations_task_names") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_apps.go b/api/resource_apps.go index 974e8be..1509af6 100644 --- a/api/resource_apps.go +++ b/api/resource_apps.go @@ -71,6 +71,7 @@ func (client *Client) getAppsPage(ctx context.Context, orgID *string, role *stri ` req := client.NewRequest(query) + ctx = ctxWithAction(ctx, "get_apps_page") if orgID != nil { req.Var("org", *orgID) } @@ -100,6 +101,7 @@ func (client *Client) GetAppID(ctx context.Context, appName string) (string, err req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_id") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -199,6 +201,7 @@ func (client *Client) GetApp(ctx context.Context, appName string) (*App, error) req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -237,6 +240,7 @@ func (client *Client) GetAppCompact(ctx context.Context, appName string) (*AppCo req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_compact") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -305,6 +309,7 @@ func (client *Client) GetAppInfo(ctx context.Context, appName string) (*AppInfo, req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_info") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -333,6 +338,7 @@ func (client *Client) GetAppBasic(ctx context.Context, appName string) (*AppBasi req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_basic") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -359,6 +365,7 @@ func (client *Client) GetAppMonitoring(ctx context.Context, appName string) (*Ap req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_monitoring") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -393,6 +400,7 @@ func (client *Client) GetAppPostgres(ctx context.Context, appName string) (*AppP req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_postgres") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -427,6 +435,7 @@ func (client *Client) CreateApp(ctx context.Context, input CreateAppInput) (*App req := client.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "create_app") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -450,6 +459,7 @@ func (client *Client) DeleteApp(ctx context.Context, appName string) error { req := client.NewRequest(query) req.Var("appId", appName) + ctx = ctxWithAction(ctx, "delete_app") _, err := client.RunWithContext(ctx, req) return err @@ -476,6 +486,7 @@ func (client *Client) MoveApp(ctx context.Context, appName string, orgID string) "appId": appName, "organizationId": orgID, }) + ctx = ctxWithAction(ctx, "move_app") data, err := client.RunWithContext(ctx, req) return &data.App, err @@ -502,6 +513,7 @@ func (client *Client) SuspendApp(ctx context.Context, appName string) (*App, err req.Var("input", map[string]string{ "appId": appName, }) + ctx = ctxWithAction(ctx, "suspend_app") data, err := client.RunWithContext(ctx, req) return &data.SuspendApp.App, err @@ -529,6 +541,8 @@ func (client *Client) ResumeApp(ctx context.Context, appName string) (*AppCompac "appId": appName, }) + ctx = ctxWithAction(ctx, "resume_app") + data, err := client.RunWithContext(ctx, req) return &data.ResumeApp.App, err } @@ -551,6 +565,7 @@ func (client *Client) RestartApp(ctx context.Context, appName string) (*App, err req.Var("input", map[string]string{ "appId": appName, }) + ctx = ctxWithAction(ctx, "restart_app") data, err := client.RunWithContext(ctx, req) return &data.RestartApp.App, err @@ -574,6 +589,7 @@ func (client *Client) ResolveImageForApp(ctx context.Context, appName, imageRef req := client.NewRequest(query) req.Var("appName", appName) req.Var("imageRef", imageRef) + ctx = ctxWithAction(ctx, "resolve_image") data, err := client.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_certificates.go b/api/resource_certificates.go index 434443e..4cbf85a 100644 --- a/api/resource_certificates.go +++ b/api/resource_certificates.go @@ -20,6 +20,7 @@ func (c *Client) GetAppCertificates(ctx context.Context, appName string) ([]AppC req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_certificates") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -75,6 +76,7 @@ func (c *Client) CheckAppCertificate(ctx context.Context, appName, hostname stri "appId": appName, "hostname": hostname, }) + ctx = ctxWithAction(ctx, "check_app_certificates") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -128,6 +130,7 @@ func (c *Client) AddCertificate(ctx context.Context, appName, hostname string) ( req.Var("appId", appName) req.Var("hostname", hostname) + ctx = ctxWithAction(ctx, "add_certificates") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -156,6 +159,7 @@ func (c *Client) DeleteCertificate(ctx context.Context, appName, hostname string req.Var("appId", appName) req.Var("hostname", hostname) + ctx = ctxWithAction(ctx, "delete_certificates") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_config.go b/api/resource_config.go index 3c4bc66..cb093d8 100644 --- a/api/resource_config.go +++ b/api/resource_config.go @@ -15,6 +15,7 @@ func (client *Client) GetConfig(ctx context.Context, appName string) (*AppConfig req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_config") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -42,6 +43,7 @@ func (client *Client) ParseConfig(ctx context.Context, appName string, definitio req := client.NewRequest(query) req.Var("appName", appName) req.Var("definition", definition) + ctx = ctxWithAction(ctx, "parse_config") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -64,6 +66,7 @@ func (client *Client) ValidateConfig(ctx context.Context, appName string, defini req := client.NewRequest(query) req.Var("definition", definition) + ctx = ctxWithAction(ctx, "validate_config") data, err := client.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_deploy.go b/api/resource_deploy.go index fddddc7..6aecef6 100644 --- a/api/resource_deploy.go +++ b/api/resource_deploy.go @@ -32,6 +32,7 @@ func (client *Client) DeployImage(ctx context.Context, input DeployImageInput) ( req := client.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "deploy_image") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -82,6 +83,7 @@ func (c *Client) GetDeploymentStatus(ctx context.Context, appName string, deploy req.Var("appName", appName) req.Var("deploymentId", deploymentID) req.Var("evaluationId", evaluationID) + ctx = ctxWithAction(ctx, "get_deployment_status") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -113,6 +115,7 @@ func (c *Client) GetReleaseCommand(ctx context.Context, id string) (*ReleaseComm req := c.NewRequest(query) req.Var("id", id) + ctx = ctxWithAction(ctx, "get_release_command") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -132,6 +135,7 @@ func (c *Client) CanPerformBluegreenDeployment(ctx context.Context, appName stri req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "can_perform_bluegreen_deployment") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_dns.go b/api/resource_dns.go index 147f9dd..fee1186 100644 --- a/api/resource_dns.go +++ b/api/resource_dns.go @@ -28,6 +28,7 @@ func (c *Client) GetDNSRecords(ctx context.Context, domainName string) ([]*DNSRe req := c.NewRequest(query) req.Var("domainName", domainName) + ctx = ctxWithAction(ctx, "get_dns_records") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -55,6 +56,7 @@ func (c *Client) ExportDNSRecords(ctx context.Context, domainId string) (string, req.Var("input", map[string]interface{}{ "domainId": domainId, }) + ctx = ctxWithAction(ctx, "export_dns_records") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -93,6 +95,7 @@ func (c *Client) ImportDNSRecords(ctx context.Context, domainId string, zonefile "domainId": domainId, "zonefile": zonefile, }) + ctx = ctxWithAction(ctx, "import_dns_records") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_doctor.go b/api/resource_doctor.go index 99934d9..6a93ffc 100644 --- a/api/resource_doctor.go +++ b/api/resource_doctor.go @@ -12,6 +12,7 @@ func (c *Client) CreateDoctorUrl(ctx context.Context) (putUrl string, err error) ` req := c.NewRequest(query) + ctx = ctxWithAction(ctx, "create_doctor_url") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_domains.go b/api/resource_domains.go index 2c8474a..530611c 100644 --- a/api/resource_domains.go +++ b/api/resource_domains.go @@ -22,7 +22,7 @@ func (c *Client) GetDomains(ctx context.Context, organizationSlug string) ([]*Do ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "get_domains") req.Var("slug", organizationSlug) data, err := c.RunWithContext(ctx, req) @@ -56,7 +56,7 @@ func (c *Client) GetDomain(ctx context.Context, name string) (*Domain, error) { ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "get_domain") req.Var("name", name) data, err := c.RunWithContext(ctx, req) @@ -85,13 +85,13 @@ func (c *Client) CreateDomain(organizationID string, name string) (*Domain, erro ` req := c.NewRequest(query) - + ctx := ctxWithAction(context.Background(), "create_domain") req.Var("input", map[string]interface{}{ "organizationId": organizationID, "name": name, }) - data, err := c.Run(req) + data, err := c.RunWithContext(ctx, req) if err != nil { return nil, err } @@ -116,7 +116,7 @@ func (c *Client) CheckDomain(ctx context.Context, name string) (*CheckDomainResu ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "check_domain") req.Var("input", map[string]string{"domainName": name}) data, err := c.RunWithContext(ctx, req) @@ -145,13 +145,13 @@ func (c *Client) CreateAndRegisterDomain(organizationID string, name string) (*D ` req := c.NewRequest(query) - + ctx := ctxWithAction(context.Background(), "create_and_register_domain") req.Var("input", map[string]interface{}{ "organizationId": organizationID, "name": name, }) - data, err := c.Run(req) + data, err := c.RunWithContext(ctx, req) if err != nil { return nil, err } diff --git a/api/resource_health_check_handlers.go b/api/resource_health_check_handlers.go index d025dd2..454c390 100644 --- a/api/resource_health_check_handlers.go +++ b/api/resource_health_check_handlers.go @@ -18,6 +18,7 @@ func (client *Client) GetHealthCheckHandlers(ctx context.Context, organizationSl req := client.NewRequest(q) req.Var("slug", organizationSlug) + ctx = ctxWithAction(ctx, "get_healthcheck_and_handlers") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -41,6 +42,7 @@ func (client *Client) SetSlackHealthCheckHandler(ctx context.Context, input SetS req := client.NewRequest(q) req.Var("input", input) + ctx = ctxWithAction(ctx, "set_slack_healthcheck_handler") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -64,6 +66,7 @@ func (client *Client) SetPagerdutyHealthCheckHandler(ctx context.Context, input req := client.NewRequest(q) req.Var("input", input) + ctx = ctxWithAction(ctx, "set_pagerduty_healthcheck_handler") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -87,6 +90,7 @@ func (client *Client) DeleteHealthCheckHandler(ctx context.Context, orgID string "organizationId": orgID, "name": handlerName, }) + ctx = ctxWithAction(ctx, "delete_healthcheck_handler") _, err := client.RunWithContext(ctx, req) diff --git a/api/resource_health_checks.go b/api/resource_health_checks.go index cb01c30..7bce70b 100644 --- a/api/resource_health_checks.go +++ b/api/resource_health_checks.go @@ -29,6 +29,7 @@ func (client *Client) GetAppHealthChecks(ctx context.Context, appName string, ch req.Var("checkName", checkName) req.Var("limitOutput", limitOutput) req.Var("compactOutput", compactOutput) + ctx = ctxWithAction(ctx, "get_app_healthchecks") data, err := client.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_images.go b/api/resource_images.go index df58612..cd3b915 100644 --- a/api/resource_images.go +++ b/api/resource_images.go @@ -27,6 +27,7 @@ func (client *Client) GetImageInfo(ctx context.Context, appName string) (*App, e ` req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_image_info") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -45,6 +46,7 @@ func (client *Client) GetLatestImageTag(ctx context.Context, repository string, req := client.NewRequest(query) req.Var("repository", repository) req.Var("snapshotId", snapshotId) + ctx = ctxWithAction(ctx, "get_latest_image_tag") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -69,7 +71,7 @@ func (client *Client) GetLatestImageDetails(ctx context.Context, image string) ( ` req := client.NewRequest(query) - + ctx = ctxWithAction(ctx, "get_latest_image_details") req.Var("image", image) data, err := client.RunWithContext(ctx, req) diff --git a/api/resource_ip_addresses.go b/api/resource_ip_addresses.go index e99552b..ba9eac1 100644 --- a/api/resource_ip_addresses.go +++ b/api/resource_ip_addresses.go @@ -26,6 +26,7 @@ func (c *Client) GetIPAddresses(ctx context.Context, appName string) ([]IPAddres req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_ip_addresses") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -64,7 +65,7 @@ func (c *Client) FindIPAddress(ctx context.Context, appName string, address stri ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "find_ip_address") req.Var("appName", appName) req.Var("address", address) @@ -92,6 +93,7 @@ func (c *Client) AllocateIPAddress(ctx context.Context, appName string, addrType ` req := c.NewRequest(query) + ctx = ctxWithAction(ctx, "allocate_ip_address") input := AllocateIPAddressInput{AppID: appName, Type: addrType, Region: region} if org != nil { @@ -124,7 +126,7 @@ func (c *Client) AllocateSharedIPAddress(ctx context.Context, appName string) (n ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "allocate_shared_ip_address") req.Var("input", AllocateIPAddressInput{AppID: appName, Type: "shared_v4"}) data, err := c.RunWithContext(ctx, req) @@ -145,7 +147,7 @@ func (c *Client) ReleaseIPAddress(ctx context.Context, appName string, ip string ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "release_ip_address") req.Var("input", ReleaseIPAddressInput{AppID: &appName, IP: &ip}) _, err := c.RunWithContext(ctx, req) diff --git a/api/resource_machines.go b/api/resource_machines.go index ecacc00..2d32c28 100644 --- a/api/resource_machines.go +++ b/api/resource_machines.go @@ -21,6 +21,7 @@ func (client *Client) GetMachine(ctx context.Context, machineId string) (*GqlMac req := client.NewRequest(query) req.Var("machineId", machineId) + ctx = ctxWithAction(ctx, "get_machine") data, err := client.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_monitoring.go b/api/resource_monitoring.go index 9a488d4..53e14d4 100644 --- a/api/resource_monitoring.go +++ b/api/resource_monitoring.go @@ -60,6 +60,7 @@ func (c *Client) GetAppStatus(ctx context.Context, appName string, showCompleted req := c.NewRequest(query) req.Var("appName", appName) req.Var("showCompleted", showCompleted) + ctx = ctxWithAction(ctx, "get_app_status") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -117,6 +118,7 @@ func (c *Client) GetAllocationStatus(ctx context.Context, appName string, allocI req.Var("appName", appName) req.Var("allocId", allocID) req.Var("logLimit", logLimit) + ctx = ctxWithAction(ctx, "get_allocation_status") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_organizations.go b/api/resource_organizations.go index 9858173..0cf226b 100644 --- a/api/resource_organizations.go +++ b/api/resource_organizations.go @@ -50,6 +50,8 @@ func (client *Client) GetOrganizations(ctx context.Context, filters ...Organizat req := client.NewRequest(q) filter.apply(req) + ctx = ctxWithAction(ctx, "get_organizations") + data, err := client.RunWithContext(ctx, req) if err != nil { return nil, err @@ -79,7 +81,7 @@ func (client *Client) GetOrganizationBySlug(ctx context.Context, slug string) (* ` req := client.NewRequest(q) - + ctx = ctxWithAction(ctx, "get_organization_by_slug") req.Var("slug", slug) data, err := client.RunWithContext(ctx, req) @@ -121,7 +123,7 @@ func (client *Client) GetDetailedOrganizationBySlug(ctx context.Context, slug st req := client.NewRequest(query) req.Var("slug", slug) - + ctx = ctxWithAction(ctx, "get_detailed_organization") data, err := client.RunWithContext(ctx, req) if err != nil { return nil, err @@ -150,6 +152,7 @@ func (c *Client) CreateOrganization(ctx context.Context, organizationname string req.Var("input", map[string]string{ "name": organizationname, }) + ctx = ctxWithAction(ctx, "create_organization") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -180,6 +183,7 @@ func (c *Client) CreateOrganizationWithAppsV2DefaultOn(ctx context.Context, orga "name": organizationname, "appsV2DefaultOn": true, }) + ctx = ctxWithAction(ctx, "create_organization_with_apps_v2_default_on") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -205,6 +209,8 @@ func (c *Client) DeleteOrganization(ctx context.Context, id string) (deletedid s "organizationId": id, }) + ctx = ctxWithAction(ctx, "delete_organization") + data, err := c.RunWithContext(ctx, req) if err != nil { return "", err @@ -236,6 +242,7 @@ func (c *Client) CreateOrganizationInvite(ctx context.Context, id, email string) "organizationId": id, "email": email, }) + ctx = ctxWithAction(ctx, "create_organization_invite") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -266,6 +273,7 @@ func (c *Client) DeleteOrganizationMembership(ctx context.Context, orgId, userId "userId": userId, "organizationId": orgId, }) + ctx = ctxWithAction(ctx, "delete_organization") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -297,6 +305,7 @@ func (c *Client) UpdateRemoteBuilder(ctx context.Context, orgName string, image "organizationId": org.ID, "image": image, }) + ctx = ctxWithAction(ctx, "update_remote_builder") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -318,6 +327,7 @@ func (c *Client) GetAppsV2DefaultOnForOrg(ctx context.Context, orgSlug string) ( ` req := c.NewRequest(query) req.Var("slug", orgSlug) + ctx = ctxWithAction(ctx, "get_apps_v2_default_on_for_org") resp, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_platform.go b/api/resource_platform.go index 250b1f5..8e3a88f 100644 --- a/api/resource_platform.go +++ b/api/resource_platform.go @@ -20,6 +20,7 @@ func (c *Client) PlatformRegions(ctx context.Context) ([]Region, *Region, error) ` req := c.NewRequest(query) + ctx = ctxWithAction(ctx, "platform_regions") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -57,6 +58,7 @@ func (c *Client) PlatformRegionsAll(ctx context.Context) ([]Region, error) { ` req := c.NewRequest(query) + ctx = ctxWithAction(ctx, "platform_regions_all") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -83,6 +85,7 @@ func (c *Client) PlatformVMSizes(ctx context.Context) ([]VMSize, error) { ` req := c.NewRequest(query) + ctx = ctxWithAction(ctx, "platform_vm_sizes") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_postgres.go b/api/resource_postgres.go index f1711cd..59c4001 100644 --- a/api/resource_postgres.go +++ b/api/resource_postgres.go @@ -19,6 +19,7 @@ func (client *Client) CreatePostgresCluster(ctx context.Context, input CreatePos req := client.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "create_postgres_cluster") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -49,6 +50,7 @@ func (client *Client) GetTemplateDeployment(ctx context.Context, id string) (*Te req := client.NewRequest(query) req.Var("id", id) + ctx = ctxWithAction(ctx, "get_template_deployment") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -77,6 +79,7 @@ func (client *Client) AttachPostgresCluster(ctx context.Context, input AttachPos req := client.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "attach_postgres_cluster") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -97,6 +100,7 @@ func (client *Client) DetachPostgresCluster(ctx context.Context, input DetachPos req := client.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "detach_postgres_cluster") _, err := client.RunWithContext(ctx, req) return err @@ -121,6 +125,7 @@ func (client *Client) ListPostgresDatabases(ctx context.Context, appName string) req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "list_postgres_database") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -147,6 +152,7 @@ func (client *Client) ListPostgresClusterAttachments(ctx context.Context, appNam req := client.NewRequest(query) req.Var("appName", appName) req.Var("postgresAppName", postgresAppName) + ctx = ctxWithAction(ctx, "list_postgres_cluster_attachments") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -176,6 +182,7 @@ func (client *Client) ListPostgresUsers(ctx context.Context, appName string) ([] req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "list_postgres_users") data, err := client.RunWithContext(ctx, req) if err != nil { @@ -195,6 +202,7 @@ func (client *Client) EnablePostgresConsul(ctx context.Context, appName string) ` req := client.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "enable_postgres_consul") data, err := client.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_regions.go b/api/resource_regions.go index 23244dd..c26aa83 100644 --- a/api/resource_regions.go +++ b/api/resource_regions.go @@ -21,6 +21,7 @@ func (c *Client) ConfigureRegions(ctx context.Context, input ConfigureRegionsInp req := c.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "configure_regions") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -49,6 +50,7 @@ func (c *Client) ListAppRegions(ctx context.Context, appName string) ([]Region, req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "list_app_regions") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -69,6 +71,8 @@ func (c *Client) GetNearestRegion(ctx context.Context) (*Region, error) { } `) + ctx = ctxWithAction(ctx, "get_nearest_regions") + data, err := c.RunWithContext(ctx, req) if err != nil { return nil, err diff --git a/api/resource_releases.go b/api/resource_releases.go index c9f2e81..172bf54 100644 --- a/api/resource_releases.go +++ b/api/resource_releases.go @@ -31,6 +31,7 @@ func (c *Client) GetAppReleasesNomad(ctx context.Context, appName string, limit req.Var("appName", appName) req.Var("limit", limit) + ctx = ctxWithAction(ctx, "get_app_releases_nomad") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -66,7 +67,7 @@ func (c *Client) GetAppReleasesMachines(ctx context.Context, appName, status str ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "get_app_releases_machines") req.Var("appName", appName) req.Var("limit", limit) if status != "" { @@ -97,7 +98,7 @@ func (c *Client) GetAppReleaseNomad(ctx context.Context, appName string, id stri ` req := c.NewRequest(query) - + ctx = ctxWithAction(ctx, "get_app_release_nomad") req.Var("appName", appName) req.Var("releaseId", id) @@ -134,6 +135,7 @@ func (c *Client) GetAppCurrentReleaseMachines(ctx context.Context, appName strin req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_current_release_machines") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_remote_builders.go b/api/resource_remote_builders.go index 809c214..119dcc1 100644 --- a/api/resource_remote_builders.go +++ b/api/resource_remote_builders.go @@ -29,6 +29,7 @@ func (client *Client) EnsureRemoteBuilder(ctx context.Context, orgID, appName st ` req := client.NewRequest(query) + ctx = ctxWithAction(ctx, "ensure_remote_builder") if orgID != "" { req.Var("input", EnsureRemoteBuilderInput{ diff --git a/api/resource_scale.go b/api/resource_scale.go index b4bbb50..5e8463f 100644 --- a/api/resource_scale.go +++ b/api/resource_scale.go @@ -22,6 +22,7 @@ func (c *Client) ScaleApp(ctx context.Context, appID string, regions []ScaleRegi req := c.NewRequest(query) req.Var("input", ScaleAppInput{AppID: appID, Regions: regions}) + ctx = ctxWithAction(ctx, "scale_app") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -55,6 +56,7 @@ func (c *Client) UpdateAutoscaleConfig(ctx context.Context, input UpdateAutoscal req := c.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "update_autoscale_config") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -86,6 +88,7 @@ func (c *Client) AppAutoscalingConfig(ctx context.Context, appName string) (*Aut req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "app_autoscaling_config") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -130,6 +133,7 @@ func (c *Client) AppVMResources(ctx context.Context, appName string) (VMSize, [] req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "app_vm_resources") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -175,6 +179,8 @@ func (c *Client) SetAppVMSize(ctx context.Context, appID string, group string, s MemoryMb: memoryMb, }) + ctx = ctxWithAction(ctx, "set_vm_size") + data, err := c.RunWithContext(ctx, req) if err != nil { return VMSize{}, err @@ -205,6 +211,7 @@ func (c *Client) GetAppVMCount(ctx context.Context, appID string) ([]TaskGroupCo req := c.NewRequest(query) req.Var("appName", appID) + ctx = ctxWithAction(ctx, "get_app_vm_count") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -244,6 +251,7 @@ func (c *Client) SetAppVMCount(ctx context.Context, appID string, counts map[str AppID: appID, GroupCounts: groups, }) + ctx = ctxWithAction(ctx, "set_app_vm_count") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_secrets.go b/api/resource_secrets.go index 84a5c3e..4cf8bdf 100644 --- a/api/resource_secrets.go +++ b/api/resource_secrets.go @@ -31,6 +31,7 @@ func (c *Client) SetSecrets(ctx context.Context, appName string, secrets map[str req := c.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "set_secrets") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -64,6 +65,7 @@ func (c *Client) UnsetSecrets(ctx context.Context, appName string, keys []string req := c.NewRequest(query) req.Var("input", UnsetSecretsInput{AppID: appName, Keys: keys}) + ctx = ctxWithAction(ctx, "unset_secrets") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -89,6 +91,7 @@ func (c *Client) GetAppSecrets(ctx context.Context, appName string) ([]Secret, e req := c.NewRequest(query) req.Var("appName", appName) + ctx = ctxWithAction(ctx, "get_app_secrets") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_ssh.go b/api/resource_ssh.go index e137251..d2a3bfa 100644 --- a/api/resource_ssh.go +++ b/api/resource_ssh.go @@ -22,6 +22,7 @@ query($slug: String!) { } `) req.Var("slug", slug) + ctx = ctxWithAction(ctx, "get_logged_certificates") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -43,6 +44,7 @@ mutation($input: EstablishSSHKeyInput!) { "organizationId": org.ID, "override": override, }) + ctx = ctxWithAction(ctx, "establish_ssh_key") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -88,6 +90,7 @@ mutation($input: IssueCertificateInput!) { } req.Var("input", inputs) + ctx = ctxWithAction(ctx, "issue_ssh_certificates") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_tokens.go b/api/resource_tokens.go index 496f709..d077d66 100644 --- a/api/resource_tokens.go +++ b/api/resource_tokens.go @@ -17,6 +17,7 @@ func (c *Client) RevokeLimitedAccessToken(ctx context.Context, id string) error req.Var("input", map[string]interface{}{ "id": id, }) + ctx = ctxWithAction(ctx, "revoke_limited_access_token") _, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_user.go b/api/resource_user.go index baffb01..d7e9308 100644 --- a/api/resource_user.go +++ b/api/resource_user.go @@ -9,6 +9,7 @@ func (c *Client) GetCurrentUser(ctx context.Context) (*User, error) { query { viewer { ... on User { + id email enablePaidHobby } @@ -20,6 +21,7 @@ func (c *Client) GetCurrentUser(ctx context.Context) (*User, error) { ` req := c.NewRequest(query) + ctx = ctxWithAction(ctx, "get_current_user") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_vms.go b/api/resource_vms.go index 5893960..9effde8 100644 --- a/api/resource_vms.go +++ b/api/resource_vms.go @@ -21,6 +21,7 @@ func (client *Client) RestartAllocation(ctx context.Context, appName string, all "appId": appName, "allocId": allocId, }) + ctx = ctxWithAction(ctx, "restart_allocation") _, err := client.RunWithContext(ctx, req) return err @@ -45,6 +46,7 @@ func (client *Client) StopAllocation(ctx context.Context, appName string, allocI "appId": appName, "allocId": allocId, }) + ctx = ctxWithAction(ctx, "stop_allocation") _, err := client.RunWithContext(ctx, req) return err diff --git a/api/resource_volumes.go b/api/resource_volumes.go index 5ac1359..fc43cf3 100644 --- a/api/resource_volumes.go +++ b/api/resource_volumes.go @@ -18,6 +18,7 @@ query($id: ID!) { req := c.NewRequest(query) req.Var("id", volID) + ctx = ctxWithAction(ctx, "get_app_name_from_volume") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resource_wireguard.go b/api/resource_wireguard.go index c5a6d2c..9da606a 100644 --- a/api/resource_wireguard.go +++ b/api/resource_wireguard.go @@ -22,6 +22,7 @@ query($slug: String!, $name: String!) { `) req.Var("slug", slug) req.Var("name", name) + ctx = ctxWithAction(ctx, "get_wg_peer") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -49,6 +50,7 @@ query($slug: String!) { } `) req.Var("slug", slug) + ctx = ctxWithAction(ctx, "get_wg_peers") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -88,6 +90,7 @@ mutation($input: AddWireGuardPeerInput!) { } req.Var("input", inputs) + ctx = ctxWithAction(ctx, "create_wg_peers") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -111,6 +114,7 @@ mutation($input: RemoveWireGuardPeerInput!) { "organizationId": org.ID, "name": name, }) + ctx = ctxWithAction(ctx, "remove_wg_peer") _, err := c.RunWithContext(ctx, req) @@ -129,6 +133,7 @@ mutation($input: CreateDelegatedWireGuardTokenInput!) { "organizationId": org.ID, "name": name, }) + ctx = ctxWithAction(ctx, "create_deletegated_wg_token") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -161,6 +166,7 @@ mutation($input: DeleteDelegatedWireGuardTokenInput!) { req := c.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "delete_deletegated_wg_token") _, err := c.RunWithContext(ctx, req) @@ -180,6 +186,7 @@ query($slug: String!) { } `) req.Var("slug", slug) + ctx = ctxWithAction(ctx, "get_deletegated_wg_tokens") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -199,6 +206,7 @@ func (c *Client) ClosestWireguardGatewayRegion(ctx context.Context) (*Region, er } } `) + ctx = ctxWithAction(ctx, "closest_wg_gateway_region") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -220,6 +228,7 @@ mutation($input: ValidateWireGuardPeersInput!) { req.Var("input", map[string]interface{}{ "peerIps": peerIPs, }) + ctx = ctxWithAction(ctx, "validate_wg_peers") data, err := c.RunWithContext(ctx, req) if err != nil { diff --git a/api/resources_migration.go b/api/resources_migration.go index 1a7fd81..0120411 100644 --- a/api/resources_migration.go +++ b/api/resources_migration.go @@ -16,6 +16,7 @@ func (c *Client) MigrateNomadToMachines(ctx context.Context, input NomadToMachin ` req := c.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "migrate_nomad_to_machines") data, err := c.RunWithContext(ctx, req) if err != nil { @@ -37,6 +38,7 @@ func (c *Client) MigrateNomadToMachinesPrep(ctx context.Context, input NomadToMa ` req := c.NewRequest(query) req.Var("input", input) + ctx = ctxWithAction(ctx, "migrate_nomad_to_machines_prep") data, err := c.RunWithContext(ctx, req) if err != nil {