> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chronosphere.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateTraceBehavior



## OpenAPI

````yaml openapi/api_v1_config_openapi3_DOCUMENTATION_ONLY.json POST /api/v1/config/trace-behaviors
openapi: 3.0.3
info:
  description: >

    The Config API provides standard HTTP/JSON REST endpoints for creating,
    reading,

    updating, deleting, and listing configurable Chronosphere resources.


    Use this link to download the raw Swagger specification:

    <a href="/api/v1/config/swagger.json">/api/v1/config/swagger.json</a>
  title: Config V1 API
  version: v1
servers:
  - url: https://{tenant}.chronosphere.io
    variables:
      tenant:
        default: tenant
        description: tenant ID assigned by the service provider
security:
  - ApiKeyAuth: []
tags:
  - name: ConfigV1
paths:
  /api/v1/config/trace-behaviors:
    post:
      tags:
        - TraceBehavior
      operationId: CreateTraceBehavior
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/configv1CreateTraceBehaviorRequest'
        required: true
        x-originalParamName: body
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1CreateTraceBehaviorResponse'
          description: A successful response containing the created TraceBehavior.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: Cannot create the TraceBehavior because the request is invalid.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: >-
            Cannot create the TraceBehavior because there is a conflict with an
            existing TraceBehavior.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: An unexpected error response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
          description: An undefined error response.
components:
  schemas:
    configv1CreateTraceBehaviorRequest:
      properties:
        dry_run:
          description: >-
            If `true`, validates the specified configuration without creating
            the TraceBehavior. If the specified configuration is valid, the
            endpoint returns a partial response without the TraceBehavior. If
            the specified configuration is invalid, the endpoint returns an
            error.
          type: boolean
        trace_behavior:
          allOf:
            - $ref: '#/components/schemas/configv1TraceBehavior'
          description: The TraceBehavior to create.
      type: object
    configv1CreateTraceBehaviorResponse:
      properties:
        trace_behavior:
          $ref: '#/components/schemas/configv1TraceBehavior'
      type: object
    apiError:
      properties:
        message:
          description: An error message describing what went wrong.
          type: string
      type: object
    genericError:
      additionalProperties: true
      type: object
    configv1TraceBehavior:
      properties:
        base_head_sample_rate:
          description: >-
            Specifies the sample rate for head sampling. This rate applies to
            all root spans

            that are enrolled in head sampling, but don't have a specific rule
            defined for

            their service.
          format: double
          type: number
        base_tail_sample_rate:
          description: >-
            Specifies the base sample rate for fully assembled traces that don't
            apply to

            the `error_sample_options`, `fast_sample_options`,
            `slow_sample_options`,

            `large_trace_sample_options`, or `small_trace_sample_options`
            sampling options.
          format: double
          type: number
        created_at:
          description: >-
            Timestamp of when the TraceBehavior was created. Cannot be set by
            clients.
          format: date-time
          readOnly: true
          type: string
        description:
          type: string
        error_sample_options:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorErrorSampleOptions'
          description: >-
            Optional. Specifies sampling options for traces whose root span is
            an error.
        fast_sample_options:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorFastSampleOptions'
          description: >-
            Optional. Specifies sampling options for traces whose root span
            duration is less

            than the specified threshold.
        large_trace_sample_options:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorLargeTraceSampleOptions'
          description: >-
            Optional. Specifies sampling options for traces with spans greater
            than or equal

            to the specified threshold.
        name:
          description: >-
            The name of the TraceBehavior. You can modify this value after the
            TraceBehavior is created.
          type: string
        slow_sample_options:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorSlowSampleOptions'
          description: >-
            Optional. Specifies sampling options for traces whose root span
            duration is

            greater than the specified threshold.
        slug:
          description: >-
            The unique identifier of the TraceBehavior. If a `slug` isn't
            provided, one is generated based on the `name` field. You can't
            modify this field after the TraceBehavior is created.
          type: string
        small_trace_sample_options:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorSmallTraceSampleOptions'
          description: >-
            Optional. Specifies sampling options for traces with spans less than
            or equal to

            the specified threshold.
        updated_at:
          description: >-
            Timestamp of when the TraceBehavior was last updated. Cannot be set
            by clients.
          format: date-time
          readOnly: true
          type: string
      required:
        - name
      type: object
    TraceBehaviorErrorSampleOptions:
      properties:
        enabled:
          description: Determines whether or not to define options for error traces.
          type: boolean
        sample_rate:
          description: Specifies the sample rate for traces with errors.
          format: double
          type: number
        sampling_type:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorSamplingType'
          description: Specifies the sampling type.
      type: object
    TraceBehaviorFastSampleOptions:
      properties:
        enabled:
          description: Determines whether or not to define options for fast traces.
          type: boolean
        max_duration_seconds:
          description: >-
            Duration in seconds under which traces are sampled according to the
            given

            sample rate.
          format: double
          type: number
        sample_rate:
          description: Defines the sample rate for traces during a specified duration.
          format: double
          type: number
        sampling_type:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorSamplingType'
          description: Specifies the sampling type.
      type: object
    TraceBehaviorLargeTraceSampleOptions:
      properties:
        enabled:
          description: Determines whether or not to define options for large traces.
          type: boolean
        sample_rate:
          description: Defines the sample rate for traces during a specified duration.
          format: double
          type: number
        sampling_type:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorSamplingType'
          description: Specifies the sampling type.
        span_count_threshold:
          description: >-
            Defines the sampling rate for large traces. If the number of spans
            in the

            trace is grater than or equal to (`>=`) the `span_count_threshold`,
            the trace

            is sampled according to the given sample rate.
          format: int64
          type: integer
      type: object
    TraceBehaviorSlowSampleOptions:
      properties:
        enabled:
          description: Determines whether or not to define options for slow traces.
          type: boolean
        min_duration_seconds:
          description: >-
            Duration in seconds under which traces are sampled according to the
            given

            sample rate.
          format: double
          type: number
        sample_rate:
          description: Defines the sample rate for traces during a specified duration.
          format: double
          type: number
        sampling_type:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorSamplingType'
          description: Specifies the sampling type.
      type: object
    TraceBehaviorSmallTraceSampleOptions:
      properties:
        enabled:
          description: Determines whether or not to define options for small traces.
          type: boolean
        sample_rate:
          description: Defines the sample rate for traces during a specified duration.
          format: double
          type: number
        sampling_type:
          allOf:
            - $ref: '#/components/schemas/TraceBehaviorSamplingType'
          description: Specifies the sampling type.
        span_count_threshold:
          description: >-
            Defines the sampling rate for small traces. If the number of spans
            in the

            trace is less than or equal to (`<=`) the `span_count_threshold`,
            the trace is

            sampled according to the given sample rate.
          format: int64
          type: integer
      type: object
    TraceBehaviorSamplingType:
      description: |2-
         - LOW_VALUE: Match indicates a low value trace. With multiple low value matches sample at the lowest rate.
         - HIGH_VALUE: Match indicates a high value trace. With multiple high value matches sample at the highest rate.
      enum:
        - LOW_VALUE
        - HIGH_VALUE
      type: string
  securitySchemes:
    ApiKeyAuth:
      description: Chronosphere API token
      in: header
      name: API-Token
      type: apiKey

````