Skip to content

[BUG]: Incompatible with grape 3.1.x #5359

@pkopac

Description

@pkopac

Tracer Version(s)

2.28.0

Ruby Version(s)

ruby 3.4.8 (2025-12-17 revision 995b59f666) +YJIT +PRISM [x86_64-linux]

Relevent Library and Version(s)

grape 3.1.1

Bug Report

There are breaking changes in grape's recent minor version, which is not DataDog's fault, but the library needs to be adapted.

AI explanation:

Grape 3.1.0 removed the public attr_reader :base from Grape::API::Instance (in https://github.com/ruby-grape/grape/pull/2633). The Datadog gem's Grape integration calls
  api.base.to_s in its api_view method:

  # datadog/tracing/contrib/grape/endpoint.rb
  def api_view(api)
    if defined?(::Grape::API::Instance) && api <= ::Grape::API::Instance
      api.base.to_s   # ← this method no longer exists in Grape 3.1.x
    else
      api.to_s
    end
  end

  Datadog 2.28.0 hasn't been updated to handle this breaking change in Grape 3.1.x.

https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/tracing/contrib/grape/endpoint.rb#L260

Reproduction Code

No response

Configuration Block

No response

Error Logs

[datadog] (/usr/local/bundle/gems/datadog-2.28.0/lib/datadog/tracing/contrib/grape/endpoint.rb:80:in 'Datadog::Tracing::Contrib::Grape::Endpoint.endpoint_start_process') undefined method 'base' for class #Class:0x00007fdf16a4d7b8

Operating System

No response

How does Datadog help you?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugInvolves a bugcommunityWas opened by a community member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions