Comments (14)
No problem. I can definitely imagine that our tests aren't paying attention to errors in the logs, just whether the end result is successful.
from skylight-ruby.
This ticket was quite old, @benalavi what version of the agent and dependencies are you using? If you can send a copy of your Gemfile.lock to [email protected] (or via the in-app messenger), that would be quite helpful. We have overhauled the implementation of the agent quite significantly since this was originally reported, so it may be a different issue if you are still seeing this in a recent version of the agent.
from skylight-ruby.
Here is a minimal test case:
Gemfile
source "https://rubygems.org"
ruby "3.0.1"
gem "rack"
gem "puma"
gem "sinatra"
gem "tilt"
gem "haml"
gem "skylight"
config.ru
# frozen_string_literal: true
require "sinatra/base"
require "skylight/sinatra"
Skylight.start! file: "skylight.yml"
class Test < Sinatra::Base
get "/" do
haml ""
end
end
run Test
skylight.yml
# otherwise says empty file and won't start
ignored_endpoints:
Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
concurrent-ruby (1.1.8)
haml (5.2.1)
temple (>= 0.8.0)
tilt
i18n (1.8.10)
concurrent-ruby (~> 1.0)
minitest (5.14.4)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.7)
puma (5.2.2)
nio4r (~> 2.0)
rack (2.2.3)
rack-protection (2.1.0)
rack
ruby2_keywords (0.0.4)
sinatra (2.1.0)
mustermann (~> 1.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
tilt (~> 2.0)
skylight (5.0.1)
activesupport (>= 5.2.0)
temple (0.8.2)
tilt (2.0.10)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
zeitwerk (2.4.2)
PLATFORMS
x86_64-darwin-18
DEPENDENCIES
haml
puma
rack
sinatra
skylight
tilt
RUBY VERSION
ruby 3.0.1p64
BUNDLED WITH
2.2.15
Run commands:
SKYLIGHT_AUTHENTICATION=... bundle exec rackup
curl 127.0.0.1:9292
curl 127.0.0.1:9292
Server output:
Puma starting in single mode...
* Puma version: 5.2.2 (ruby 3.0.1-p64) ("Fettisdagsbulle")
* Min threads: 0
* Max threads: 5
* Environment: development
* PID: 97390
* Listening on http://127.0.0.1:9292
* Listening on http://[::1]:9292
Use Ctrl-C to stop
Haml::TempleEngine: Option :sky_virtual_path is invalid
127.0.0.1 - - [29/Apr/2021:19:06:55 -0700] "GET / HTTP/1.1" 200 - 0.0447
Haml::TempleEngine: Option :sky_virtual_path is invalid
127.0.0.1 - - [29/Apr/2021:19:06:58 -0700] "GET / HTTP/1.1" 200 - 0.0031
In our case we render quite a few haml templates in some of our views and so we get tons of Haml::TempleEngine: Option :sky_virtual_path is invalid
lines emitted for each route. I assume it is happening each time haml
is called.
We also just found that Haml::TempleEngine.disable_option_validator!
stops the log lines from being emitted, and is probably a better idea than filtering them out of our log collector.
from skylight-ruby.
Thanks for the reproduction and workaround. Sorry for the trouble!
It seems like the problem is due to this option being added here:
skylight-ruby/lib/skylight/probes/sinatra.rb
Lines 42 to 44 in a312f9d
We'll look into refactoring this to avoid the warning. In the meantime, Haml::TempleEngine.define_options(:sky_virtual_path)
is a more precise workaround to silence the warning, and should be harmless.
from skylight-ruby.
Here is a modified version of the self-contained reproduction:
# config.ru
# run with SKYLIGHT_AUTHENTICATION=... rackup
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
ruby "3.0.1"
gem "pry"
gem "rack"
gem "puma"
gem "sinatra"
gem "tilt"
gem "haml"
gem "skylight"
end
require "skylight/sinatra"
# Haml::TempleEngine.define_options(:sky_virtual_path)
Skylight.start!
class Test < Sinatra::Base
get "/" do
haml ""
end
end
from skylight-ruby.
@runar we're passing an extra option to the template engine that we use later to track what's happening in Sinatra. Slim has decided to add an extra layer of validation, which causes this extra option to throw an error, because the authors of Slim assumed that passing an unknown option is an error.
I'm currently on vacation but I'll try to take a look at an alternative mitigation that we can apply automatically in Skylight when I get back.
from skylight-ruby.
@wycats Thank you so much for your fast and useful response. I’ll continue with disabling the option validator for now. Enjoy your vacation! 😃
from skylight-ruby.
Thanks for the still-timely workaround, @runar c:
from skylight-ruby.
@runar @hakusaro do either of you happen to know if this is still an issue?
from skylight-ruby.
Not off the top of my head. I would assume that unless you've targeted this issue directly it's still a problem.
Sinatra is a pretty tiny framework. You should just be able to setup Skylight and a basic get request with the Slim renderer and reproduce it though.
from skylight-ruby.
@hakusaro thanks for the quick reply. I'll try to do this next time I have a chance.
from skylight-ruby.
I'll let you know if I can beat you to it. It might be a more-complicated setup than just trivial Sinatra + slim, but I want to double check that before getting back to you.
from skylight-ruby.
I think we're seeing this same issue with Sinatra + HAML. Specifically Haml::TempleEngine: Option :sky_virtual_path is invalid
. In our case we're now filtering it back out on the way into our log storage but it was generating quite a bit of log volume for a bit.
from skylight-ruby.
@benalavi The current master branch (on rubygems as 5.1.0.beta2) mitigates this issue by not passing the custom option.
from skylight-ruby.
Related Issues (20)
- Remove git dependency? HOT 3
- Allow yml files to be named yml.erb HOT 2
- 100% CPU Usage On Puma Workers at "idle" in Development. HOT 9
- Segmentation Fault HOT 1
- Middleware thread safey HOT 2
- Issue after gems upgrade HOT 4
- Delete old releases HOT 1
- Undefined method `safe_constantize' HOT 1
- Redis Deprecation warnings HOT 2
- Error after upgrading searchkick & elasticsearch gems HOT 3
- Possibly incorrect allocations reported HOT 1
- How to fix this warning HOT 2
- Verifying that probes are working HOT 1
- Puma 6 is breaking Skylight HOT 6
- Support for Psych 5 HOT 11
- Ignore specific GraphQL request
- No event sequence rendered for endpoints
- Incompatibility with GraphQL-Ruby 2.0.18+ out-of-the-box HOT 3
- Skylight and Sentry stacktrace issues HOT 10
- Join forces with stackprof HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skylight-ruby.