File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
spec/datadog/appsec/contrib/sinatra Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1212RSpec . describe 'Schema extraction for API security in Sinatra' do
1313 include Rack ::Test ::Methods
1414
15+ let ( :telemetry ) { instance_double ( Datadog ::Core ::Telemetry ::Component ) }
16+
1517 before do
18+ allow ( telemetry ) . to receive ( :inc )
19+ allow ( Datadog ::AppSec ) . to receive ( :telemetry ) . and_return ( telemetry )
20+
1621 Datadog . configure do |config |
1722 config . tracing . enabled = true
1823 config . tracing . instrument :sinatra
168173 expect ( response ) . to be_ok
169174 expect ( http_service_entry_span . tags ) . to have_key ( '_dd.appsec.s.res.body' )
170175 end
176+
177+ it 'reports api_security.request.schema telemetry with framework tag' do
178+ expect ( telemetry ) . to have_received ( :inc ) . with (
179+ Datadog ::AppSec ::Ext ::TELEMETRY_METRICS_NAMESPACE ,
180+ 'api_security.request.schema' ,
181+ 1 ,
182+ tags : { framework : 'sinatra' }
183+ )
184+ end
171185 end
172186end
You can’t perform that action at this time.
0 commit comments