Configuring platform SDKs

Connect your applications to BugSnag On-premise.

BugSnag Error reporting SDKs

By default, BugSnag reporting libraries will send errors to notify.bugsnag.com and sessions, which enable BugSnag to provide and compare stability scores between releases, to sessions.bugsnag.com.

You’ll need to configure your applications to send errors and sessions to your On-premise installation, at the hostname/port you configured for the BugSnag Event Server and BugSnag Sessions Server endpoints.

For example, in Ruby apps:

Bugsnag.configure do |config|
  config.api_key = "YOUR_API_KEY"
  config.endpoints = Bugsnag::EndpointConfiguration.new(
    "https://notify-bugsnag.internal.example.com"
    "https://sessions-bugsnag.internal.example.com"
  )
end

For Browser JavaScript:

Bugsnag.start({
  apiKey: 'YOUR_API_KEY',
  endpoints: {
    notify: 'https://bugsnag-notify.example.com',
    sessions: 'https://bugsnag-sessions.example.com'
  }
})

For other libraries see the configuration options for your platform.

BugSnag Performance SDKs

By default, BugSnag performance libraries will send trace data to otlp.bugsnag.com/v1/traces.

You’ll need to configure your applications to send trace data to your On-premise installation, at the hostname/port you configured for the BugSnag Trace Server endpoint.

For example in browser JavaScript applications:

BugsnagPerformance.start({
  apiKey: 'YOUR_API_KEY',
  endpoint: 'https://otlp.example.com/v1/traces'
})

For other libraries see the configuration options for your platform.

OpenTelemetry SDKs

For details about configuration options see the OpenTelemetry OTLP Exporter Configuration documentation.

In order to receive spans please follow the single node or high availability guide to set up a suitable load balancer.

Send OpenTelemetry spans with api key as a subdomain

If you have set up a load balancer with support for the API key as a subdomain, you can include the project API key as a subdomain in the endpoint URL.

export OTEL_EXPORTER_OTLP_PROTOCOL="grpc"
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://<PROJECT_API_KEY>.otlp.example.com:4317"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://<PROJECT_API_KEY>.otlp.example.com:4318/v1/traces"

Send OpenTelemetry spans with api key in headers

If you do not wish to configure a subdomain for the trace endpoint, then you can include the projet API key in the headers of the request.

export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Bugsnag-Api-Key=<PROJECT_API_KEY>"
export OTEL_EXPORTER_OTLP_PROTOCOL="grpc"
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://otlp.example.com:4317"
export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Bugsnag-Api-Key=<PROJECT_API_KEY>"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://otlp.example.com:4318/v1/traces"

OpenTelemetry Collector

To use an OpenTelemetry collector, you will need to use your organization API key. You should also configure service name mappings to ensure the trace’s spans get routed to the correct project. See our collector guide for more information on these concepts.

In order to receive spans please follow the single node or high availability guide to set up a suitable load balancer.

Send OpenTelemetry spans with api key as a subdomain

If you have set up a load balancer with support for the API key as a subdomain, you can include your organization API key as a subdomain in the endpoint URL.

exporters:
  otlp/bugsnag:
    endpoint: "<ORGANIZATION_API_KEY>.otlp.example.com:4317"
exporters:
  otlphttp/bugsnag:
    traces_endpoint: "https://<ORGANIZATION_API_KEY>.otlp.example.com:4318/v1/traces"

Send OpenTelemetry spans with api key in headers

If you do not wish to configure a subdomain for the trace endpoint, then you can include your organization API key in the headers of the request.

exporters:
  otlp/bugsnag:
    endpoint: "otlp.example.com:4317"
    headers:
      Bugsnag-Api-Key: "<ORGANIZATION_API_KEY>"
exporters:
  otlphttp/bugsnag:
    traces_endpoint: "https://otlp.example.com:4318/v1/traces"
    headers:
      Bugsnag-Api-Key: "<ORGANIZATION_API_KEY>"

Reporting builds

If you are using a build tool integration you’ll need to configure the Build API endpoint to the hostname/port of your BugSnag Build API endpoint. See the docs for your build tool for details.

Uploading mapping files

On platforms that require mapping files to deobfuscate or unminify stacktraces, you’ll need to set the endpoint to the hostname/port of your BugSnag Upload Server: