Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:07
    scala-steward-bot opened #1188
  • Apr 08 10:45

    magnolia-k on main

    Update metrics4-scala to 4.1.19… (compare)

  • Apr 08 10:45
    magnolia-k closed #1186
  • Apr 08 10:45

    magnolia-k on main

    Update mockito-core to 3.9.0 (#… (compare)

  • Apr 08 10:45
    magnolia-k closed #1185
  • Apr 08 10:45

    magnolia-k on main

    Update akka-actor, akka-testkit… (compare)

  • Apr 08 10:45
    magnolia-k closed #1187
  • Apr 08 06:03
    scala-steward-bot synchronize #1186
  • Apr 08 05:55

    magnolia-k on main

    Update metrics-servlet, metrics… (compare)

  • Apr 08 05:55
    magnolia-k closed #1184
  • Apr 07 17:46
    scala-steward-bot opened #1187
  • Apr 07 16:03
    scala-steward-bot opened #1186
  • Apr 07 14:58
    scala-steward-bot opened #1185
  • Apr 07 14:00
    scala-steward-bot opened #1184
  • Apr 04 22:43

    magnolia-k on main

    Update sbt to 1.5.0 (#1183) (compare)

  • Apr 04 22:43
    magnolia-k closed #1183
  • Apr 04 18:22
    scala-steward-bot opened #1183
  • Apr 03 08:22

    magnolia-k on main

    Update atmosphere-runtime to 2.… (compare)

  • Apr 03 08:22
    magnolia-k closed #1182
  • Apr 02 17:45
    scala-steward-bot opened #1182
Naoki Takezoe
@takezoe
@nilskp Actually, a creator of Scalatra was a creator of http4s. So, Scalatra and http4s had a connection. One good point of http4s was that it supports Servlet based backend not only Netty based non-blocking I/O backend. Anyway, I think migration to http4s would never happen on Scalatra due to the lack of our development resources.
My Nguyen
@nguyenmv2
Hi guys, I'm brand new to both Scalatra and Scala. Following the "First Step" tutorial. Run into a weird issue when I run sbt on a fresh scalatra app, instead of binding to a normal network ( localhost:8000 ) it binds to a unix socket. How would I change the port binding? I mistook sbt server with the jetty server
Naoki Takezoe
@takezoe
I found a video of the presentation about Scalatra + Slick + ZIO at ScalaUA conference!
https://www.youtube.com/watch?v=mAQAxh-K14g
Alexis Côté
@popojargo
@sharkgua I've made some PR to fix that
kiran prakash
@kiranprakash154_twitter
Are there suggestions on adding tracing to web services using Scalatra?
Adrian A.
@aadrian
@kiranprakash154_twitter I don't think that tracing is a Scalatra specific issue. If adding Context to the Logging is not enough http://logback.qos.ch/manual/mdc.html than maybe something like https://github.com/openzipkin/zipkin would do it.
kiran prakash
@kiranprakash154_twitter
Hi @aadrian Thanks for your reply. To set some context, I'm handling a Scalatra service and want to integrate tracing into it to see APM traces in Datadog. I was told by one of my coworkers that using java agent (Datadog's Java Agent) can be tricky with a scala application especially if its multi-threaded (our application is) since contexts can get lost between threads. I'm new to Scala and Sinatra and that's why I'm here to see if there is a suggestion already out there for this purpose and get some help from this community.
Naoki Takezoe
@takezoe
@kiranprakash154_twitter Scalatra is based on Java servlet and Datadog APM should support it. Though I've never tried it with Scalatra apps, I think no special consideration would be unnecessary to apply dd-java-agent to Scalatra apps.
kiran prakash
@kiranprakash154_twitter
Great. Thanks, Naoki
Eamonn Sullivan
@eamonnsullivan
Hi all, I have (what I hope) is a simple question. I'm trying to use scalatra-swagger to help my team keep the swagger docs updated. I like that we can use the DSL right next to the API-level code, so you can see more easily if the docs are out-of-date. However, several of our APIs use Json schemas to define the body parameter of a request or responses, which go a bit further than a simple case class. Is there a way to use these in the generated swagger.json?
7 replies
Naoki Takezoe
@takezoe
@magnolia-k Have we enabled CircleCI integration? It looks to has been triggered since 2 days ago.
https://app.circleci.com/pipelines/github/scalatra/scalatra
I don't see CircleCI integration in GitHub repository settings, but I see a webhook configuration for CircleCI.
magnolia
@magnolia-k
@takezoe
In turning off the Travis-CI integration, I turned on Circle-CI once, but I guess I forgot to turn it off!
GitHub Action is enough, so turn it off
Naoki Takezoe
@takezoe
I see, thanks. I also deleted old Jenkins webhook and uninstalled Travis App.
Naoki Takezoe
@takezoe
But I realized that we need to use TravisCI to deploy Scalatra's web site after uninstalling Travis App...
Ingemar Ådahl
@ingemaradahl
Would there be a lot of work to publish a 2.7.1?
Naoki Takezoe
@takezoe
@ingemaradahl Do you need 2.7.1? If so, we will release 2.7.1 soon.
Ingemar Ådahl
@ingemaradahl
Naoki Takezoe
@takezoe
I see. Then, we will release Scalatra 2.7.1 this week.
Ingemar Ådahl
@ingemaradahl
Thank you! :heart:
Naoki Takezoe
@takezoe
@ingemaradahl Scalatra 2.7.1 has been published. https://github.com/scalatra/scalatra/tree/v2.7.1
Ingemar Ådahl
@ingemaradahl
Awesome, first thing I'll be doing Monday morning :)
Carlos Eduardo
@carlosedp
Hi all
Is it possible to use scalatra-metrics to generate Prometheus metrics?
I'm pretty new into scalatra and looking at the possibilities
Naoki Takezoe
@takezoe
@carlosedp Though I'm not familiar with Prometheus, scalatra-metrics is based on DropWizard's metrics library and integrating with Prometheus seems easy according to this article: https://www.robustperception.io/exposing-dropwizard-metrics-to-prometheus
Carlos Eduardo
@carlosedp
Nice, thanks @takezoe :)
Carlos Eduardo
@carlosedp
Hi all, I've solved the usage of Prometheus for metrics...
Another question... is there a way to access the jetty server from the ScalatraBootstrap class?
so I can add a statistics handler to it...
I need to do something like
    // Configure StatisticsHandler.
    val stats = new StatisticsHandler()
    stats.setHandler(server.getHandler())
    server.setHandler(stats)
    // Register collector.
    new JettyStatisticsCollector(stats).register()
Naoki Takezoe
@takezoe
@carlosedp I think we cannot access Jetty from ScalatraBootstrap because it's independent from servlet container implementation. You may need to write your own bootstrap class like this: https://github.com/gitbucket/gitbucket/blob/master/src/main/java/JettyLauncher.java
Carlos Eduardo
@carlosedp
humm.. got it...
override the whole bootstrap
that's too much work... hehe
Naoki Takezoe
@takezoe
@carlosedp Haha. By the way, how would you run your Scalatra based application? Create war file and deploy on Jetty?
Carlos Eduardo
@carlosedp
I still don't know.. .heheeh
:) evaluating the framework right now
Naoki Takezoe
@takezoe
Oh, I see.
Carlos Eduardo
@carlosedp
like... trying to understand if I can use the tools the framework gives .. for example for logging, metrics and etc... or if I need to override and do it myself...
like the Prometheus case, I can use the framework integrations .. so makes life easier
Naoki Takezoe
@takezoe
Yeah, experimenting before using it hardly makes sense.
Carlos Eduardo
@carlosedp
yep, once committed it's hard to change
Naoki Takezoe
@takezoe
Since Scalatra is a traditional Java servlet based web framework, it's designed to run on Servlet containers such as Jetty or Tomcat. Creating a war file and deploying it on Servlet container is the basic process. However, by writing a bootstrap class like I showed above, you can also build a standalone executable jar file.
Carlos Eduardo
@carlosedp
Yes, I was thinking about it... because the idea is to have it deployed on containers
can I build a native image with it?
Naoki Takezoe
@takezoe
Ah, hmm. I have never tried that with Scalatra.
Carlos Eduardo
@carlosedp
for people interested into looking at
I've pushed a Scalatra demo project with Prometheus metrics