Skip to main content

Geoip Processor

Status Available in: contrib Maintainers: @andrzej-stencel, @michalpristas, @rogercoll Source: opentelemetry-collector-contrib

Supported Telemetry

Logs Metrics Traces

Overview

Configuration

To add geographical information, the IP address must be included in the attributes specified by the attributes configuration option (e.g., client.address and source.address by default). By default, only the resource attributes will be modified. Please refer to config.go for the config spec.

Geographical location metadata

The following resource attributes will be added if the corresponding information is found:

Configuration

The following settings can be configured:
  • providers: A map containing geographical location information providers. These providers are used to search for the geographical location attributes associated with an IP. Supported providers:
  • context (default: resource): Allows specifying the underlying telemetry context the processor will work with. Available values:
    • resource: Resource attributes.
    • record: Attributes within a data point, log record or a span.
  • attributes (default: [client.address, source.address]): An array of attribute names, which are used for the IP address lookup.

Examples

processors:
    # processor name: geoip
    geoip:
      providers:
        maxmind:
          database_path: /tmp/mygeodb
      context: record
      attributes: [client.address, source.address, custom.address]

Configuration

Example Configuration

geoip:
geoip/maxmind:
  providers:
    maxmind:
      database_path: /tmp/db
geoip/maxmind_record_context:
  context: record
  providers:
    maxmind:
      database_path: /tmp/db
geoip/invalid_providers_config:
  providers: "this should be a map"
geoip/invalid_source:
  providers:
    maxmind:
      database_path: /tmp/db
  context: not.an.otlp.context
geoip/invalid_source_attributes:
  providers:
    maxmind:
      database_path: /tmp/db
  attributes: []
geoip/custom_source_attributes:
  providers:
    maxmind:
      database_path: /tmp/db
  attributes: [client.address, source.address, custom.address]

Last generated: 2026-04-13