Skip to main content

Static Configurations

By default, configurations of the service name, tenant ID, collector, and batch span processor are pre-configured in the default configuration file. For example:

plugin_attr:
opentelemetry:
trace_id_source: x-request-id # Specify the source of the trace ID, `x-request-id` or `random`. When set to `x-request-id`,
# the value of the `x-request-id` header will be used as the trace ID.
resource: # Additional resource to append to the trace.
service.name: APISIX # Set the service name for OpenTelemetry traces.
collector:
address: 127.0.0.1:4318 # Set the address of the OpenTelemetry collector to send traces to.
request_timeout: 3 # Set the timeout for requests to the OpenTelemetry collector in seconds.
request_headers: # Set the headers to include in requests to the OpenTelemetry collector.
Authorization: token # Set the authorization header to include an access token.
batch_span_processor: # Trace span processor.
drop_on_queue_full: false # Drop spans when the export queue is full.
max_queue_size: 1024 # Set the maximum size of the span export queue.
batch_timeout: 2 # Set the timeout for span batches to wait in the export queue before
# being sent.
inactive_timeout: 1 # Set the timeout for spans to wait in the export queue before being sent,
# if the queue is not full.
max_export_batch_size: 16 # Set the maximum number of spans to include in each batch sent to the OpenTelemetry collector.
set_ngx_var: false # Export opentelemetry variables to nginx variables.

To customize these values, add the corresponding configurations to config.yaml, which takes precedence over the configurations in config-default.yaml. Reload APISIX for changes to take effect.

Parameters

See plugin common configurations for configuration options available to all plugins.

  • sampler

    object


    Sampling configuration.

    • name

      string


      default: always_off


      vaild vaule:

      always_on, always_off, trace_id_ratio, or parent_base


      Sampling strategy.

      To always sample, use always_on.

      To never sample, use always_off.

      To randomly sample based on a given ratio, use trace_id_ratio.

      To use to sampling decision of the span’s parent, use parent_base. If there is no parent, use the root sampler.

    • options

      object


      Parameters for sampling strategy.

      • fraction

        number


        default: 0


        vaild vaule:

        between 0 and 1 inclusive


        Sampling ratio when the sampling strategy is trace_id_ratio.

      • root

        object


        Root sampler when the sampling strategy is parent_base strategy.

        • name

          string


          vaild vaule:

          always_on, always_off, or trace_id_ratio


          Root sampling strategy.

        • options

          object


          Root sampling strategy parameters.

          • fraction

            number


            default: 0


            vaild vaule:

            between 0 and 1 inclusive


            Root sampling ratio when the sampling strategy is trace_id_ratio.

  • additional_attributes

    array[string]


    Additional attributes appended to the trace span. Support built-in variables in values.

  • additional_header_prefix_attributes

    array[string]


    Headers or header prefixes appended to the trace span's attributes. For example, use x-my-header" or x-my-headers-* to include all headers with the prefix x-my-headers-.


API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IRed Herring

Copyright © APISEVEN Ltd. 2019 – 2024. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation