1. Registry
  2. Packages
  3. Vercel Provider
  4. API Docs
  5. ProjectTracing
Viewing docs for Vercel v5.21.1
published on Thursday, Oct 15, 2026 by Pulumiverse
vercel logo vercel logo
Viewing docs for Vercel v5.21.1
published on Thursday, Oct 15, 2026 by Pulumiverse

    Provides a Project Tracing resource.

    Project Tracing sends OpenTelemetry traces from a project’s deployments to Vercel. Ordered sampling rules can limit which traces are retained.

    Deleting this resource disables tracing for the project.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vercel from "@pulumiverse/vercel";
    
    const example = new vercel.ProjectTracing("example", {
        projectId: exampleVercelProject.id,
        samplingRules: [{
            rate: 0.2,
            environment: "production",
            requestPath: "/api",
        }],
    });
    
    import pulumi
    import pulumiverse_vercel as vercel
    
    example = vercel.ProjectTracing("example",
        project_id=example_vercel_project["id"],
        sampling_rules=[{
            "rate": 0.2,
            "environment": "production",
            "request_path": "/api",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-vercel/sdk/v5/go/vercel"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vercel.NewProjectTracing(ctx, "example", &vercel.ProjectTracingArgs{
    			ProjectId: pulumi.Any(exampleVercelProject.Id),
    			SamplingRules: vercel.ProjectTracingSamplingRuleArray{
    				&vercel.ProjectTracingSamplingRuleArgs{
    					Rate:        pulumi.Float64(0.2),
    					Environment: pulumi.String("production"),
    					RequestPath: pulumi.String("/api"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vercel = Pulumiverse.Vercel;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Vercel.ProjectTracing("example", new()
        {
            ProjectId = exampleVercelProject.Id,
            SamplingRules = new[]
            {
                new Vercel.Inputs.ProjectTracingSamplingRuleArgs
                {
                    Rate = 0.2,
                    Environment = "production",
                    RequestPath = "/api",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumiverse.vercel.ProjectTracing;
    import com.pulumiverse.vercel.ProjectTracingArgs;
    import com.pulumi.vercel.inputs.ProjectTracingSamplingRuleArgs;
    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) {
            var example = new ProjectTracing("example", ProjectTracingArgs.builder()
                .projectId(exampleVercelProject.id())
                .samplingRules(ProjectTracingSamplingRuleArgs.builder()
                    .rate(0.2)
                    .environment("production")
                    .requestPath("/api")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: vercel:ProjectTracing
        properties:
          projectId: ${exampleVercelProject.id}
          samplingRules:
            - rate: 0.2
              environment: production
              requestPath: /api
    
    Example coming soon!
    

    Create ProjectTracing Resource

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

    Constructor syntax

    new ProjectTracing(name: string, args: ProjectTracingArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectTracing(resource_name: str,
                       args: ProjectTracingArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectTracing(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       project_id: Optional[str] = None,
                       sampling_rules: Optional[Sequence[ProjectTracingSamplingRuleArgs]] = None,
                       team_id: Optional[str] = None)
    func NewProjectTracing(ctx *Context, name string, args ProjectTracingArgs, opts ...ResourceOption) (*ProjectTracing, error)
    public ProjectTracing(string name, ProjectTracingArgs args, CustomResourceOptions? opts = null)
    public ProjectTracing(String name, ProjectTracingArgs args)
    public ProjectTracing(String name, ProjectTracingArgs args, CustomResourceOptions options)
    
    type: vercel:ProjectTracing
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "vercel_project_tracing" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ProjectTracingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ProjectTracingArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ProjectTracingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectTracingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectTracingArgs
    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 projectTracingResource = new Vercel.ProjectTracing("projectTracingResource", new()
    {
        ProjectId = "string",
        SamplingRules = new[]
        {
            new Vercel.Inputs.ProjectTracingSamplingRuleArgs
            {
                Rate = 0.0,
                Environment = "string",
                RequestPath = "string",
            },
        },
        TeamId = "string",
    });
    
    example, err := vercel.NewProjectTracing(ctx, "projectTracingResource", &vercel.ProjectTracingArgs{
    	ProjectId: pulumi.String("string"),
    	SamplingRules: vercel.ProjectTracingSamplingRuleArray{
    		&vercel.ProjectTracingSamplingRuleArgs{
    			Rate:        pulumi.Float64(0),
    			Environment: pulumi.String("string"),
    			RequestPath: pulumi.String("string"),
    		},
    	},
    	TeamId: pulumi.String("string"),
    })
    
    resource "vercel_project_tracing" "projectTracingResource" {
      lifecycle {
        create_before_destroy = true
      }
      project_id = "string"
      sampling_rules {
        rate         = 0
        environment  = "string"
        request_path = "string"
      }
      team_id = "string"
    }
    
    var projectTracingResource = new ProjectTracing("projectTracingResource", ProjectTracingArgs.builder()
        .projectId("string")
        .samplingRules(ProjectTracingSamplingRuleArgs.builder()
            .rate(0.0)
            .environment("string")
            .requestPath("string")
            .build())
        .teamId("string")
        .build());
    
    project_tracing_resource = vercel.ProjectTracing("projectTracingResource",
        project_id="string",
        sampling_rules=[{
            "rate": float(0),
            "environment": "string",
            "request_path": "string",
        }],
        team_id="string")
    
    const projectTracingResource = new vercel.ProjectTracing("projectTracingResource", {
        projectId: "string",
        samplingRules: [{
            rate: 0,
            environment: "string",
            requestPath: "string",
        }],
        teamId: "string",
    });
    
    type: vercel:ProjectTracing
    properties:
        projectId: string
        samplingRules:
            - environment: string
              rate: 0
              requestPath: string
        teamId: string
    

    ProjectTracing 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 ProjectTracing resource accepts the following input properties:

    ProjectId string
    The ID of the Project to configure tracing for.
    SamplingRules List<Pulumiverse.Vercel.Inputs.ProjectTracingSamplingRule>
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    TeamId string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    ProjectId string
    The ID of the Project to configure tracing for.
    SamplingRules []ProjectTracingSamplingRuleArgs
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    TeamId string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    project_id string
    The ID of the Project to configure tracing for.
    sampling_rules list(object)
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    team_id string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    projectId String
    The ID of the Project to configure tracing for.
    samplingRules List<ProjectTracingSamplingRule>
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    teamId String
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    projectId string
    The ID of the Project to configure tracing for.
    samplingRules ProjectTracingSamplingRule[]
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    teamId string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    project_id str
    The ID of the Project to configure tracing for.
    sampling_rules Sequence[ProjectTracingSamplingRuleArgs]
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    team_id str
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    projectId String
    The ID of the Project to configure tracing for.
    samplingRules List<Property Map>
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    teamId String
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectTracing 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 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 ProjectTracing Resource

    Get an existing ProjectTracing 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?: ProjectTracingState, opts?: CustomResourceOptions): ProjectTracing
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            project_id: Optional[str] = None,
            sampling_rules: Optional[Sequence[ProjectTracingSamplingRuleArgs]] = None,
            team_id: Optional[str] = None) -> ProjectTracing
    func GetProjectTracing(ctx *Context, name string, id IDInput, state *ProjectTracingState, opts ...ResourceOption) (*ProjectTracing, error)
    public static ProjectTracing Get(string name, Input<string> id, ProjectTracingState? state, CustomResourceOptions? opts = null)
    public static ProjectTracing get(String name, Output<String> id, ProjectTracingState state, CustomResourceOptions options)
    resources:  _:    type: vercel:ProjectTracing    get:      id: ${id}
    import {
      to = vercel_project_tracing.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    ProjectId string
    The ID of the Project to configure tracing for.
    SamplingRules List<Pulumiverse.Vercel.Inputs.ProjectTracingSamplingRule>
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    TeamId string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    ProjectId string
    The ID of the Project to configure tracing for.
    SamplingRules []ProjectTracingSamplingRuleArgs
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    TeamId string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    project_id string
    The ID of the Project to configure tracing for.
    sampling_rules list(object)
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    team_id string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    projectId String
    The ID of the Project to configure tracing for.
    samplingRules List<ProjectTracingSamplingRule>
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    teamId String
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    projectId string
    The ID of the Project to configure tracing for.
    samplingRules ProjectTracingSamplingRule[]
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    teamId string
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    project_id str
    The ID of the Project to configure tracing for.
    sampling_rules Sequence[ProjectTracingSamplingRuleArgs]
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    team_id str
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.
    projectId String
    The ID of the Project to configure tracing for.
    samplingRules List<Property Map>
    Ordered head-sampling rules for traces. If omitted, all traces are retained.
    teamId String
    The ID of the team the Project exists under. Required when configuring a team resource if a default team has not been set in the provider.

    Supporting Types

    ProjectTracingSamplingRule, ProjectTracingSamplingRuleArgs

    Rate double
    Sampling rate from 0 to 1.
    Environment string
    Environment to apply this sampling rule to. Can be production or preview.
    RequestPath string
    Request path prefix to apply this sampling rule to.
    Rate float64
    Sampling rate from 0 to 1.
    Environment string
    Environment to apply this sampling rule to. Can be production or preview.
    RequestPath string
    Request path prefix to apply this sampling rule to.
    rate number
    Sampling rate from 0 to 1.
    environment string
    Environment to apply this sampling rule to. Can be production or preview.
    request_path string
    Request path prefix to apply this sampling rule to.
    rate Double
    Sampling rate from 0 to 1.
    environment String
    Environment to apply this sampling rule to. Can be production or preview.
    requestPath String
    Request path prefix to apply this sampling rule to.
    rate number
    Sampling rate from 0 to 1.
    environment string
    Environment to apply this sampling rule to. Can be production or preview.
    requestPath string
    Request path prefix to apply this sampling rule to.
    rate float
    Sampling rate from 0 to 1.
    environment str
    Environment to apply this sampling rule to. Can be production or preview.
    request_path str
    Request path prefix to apply this sampling rule to.
    rate Number
    Sampling rate from 0 to 1.
    environment String
    Environment to apply this sampling rule to. Can be production or preview.
    requestPath String
    Request path prefix to apply this sampling rule to.

    Import

    The pulumi import command can be used, for example:

    Project Tracing can be imported by specifying the project ID.

    $ pulumi import vercel:index/projectTracing:ProjectTracing example prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

    Alternatively, specify the team ID and project ID.

    $ pulumi import vercel:index/projectTracing:ProjectTracing example team_xxxxxxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

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

    Package Details

    Repository
    vercel pulumiverse/pulumi-vercel
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vercel Terraform Provider.
    vercel logo vercel logo
    Viewing docs for Vercel v5.21.1
    published on Thursday, Oct 15, 2026 by Pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial