https://pinot.apache.org/ logo
Join Slack
Powered by
# metrics-plugin-impl
  • x

    Xiang Fu

    03/16/2021, 7:17 PM
    <!here>
  • x

    Xiang Fu

    03/16/2021, 7:17 PM
    we can move the metrics plugin discussion here
  • x

    Xiang Fu

    03/16/2021, 7:18 PM
    I think Xiaoman has some question about the listener implementation
    đź‘‹ 1
  • x

    XD (Stripe)

    03/16/2021, 7:21 PM
    <!here> I think the major problem here is that the old plugins that implemented
    MetricsRegistryRegistrationListener
    makes the server start process hang, without any clue in our log to trace it
  • x

    XD (Stripe)

    03/16/2021, 7:22 PM
    I agree that the interface change is a good direction in design; but I am a bit concerned about the other Pinot users that did the same thing will have trouble debugging
  • x

    XD (Stripe)

    03/16/2021, 7:22 PM
    It took me quite a few hours digging until I figure out
  • x

    XD (Stripe)

    03/16/2021, 7:23 PM
    Even
    jstack
    does not help
  • x

    XD (Stripe)

    03/16/2021, 7:24 PM
    I don't have a better solution to this though. Maybe a proper communication is the only way
  • x

    XD (Stripe)

    03/16/2021, 7:26 PM
    Originally I thought it was another interface change, but here we are dealing with dependencies too, so it is hard to find a good solution
  • x

    XD (Stripe)

    03/16/2021, 7:29 PM
    After reimplementing my plugin the pinot server now starts properly with my metrics plugin
  • j

    Jack

    03/16/2021, 8:06 PM
    Hey Xiaoman, thanks for reaching out! I understand your concern of removing the methods in
    PinotMetricsRegistryListener
    . While
    PinotMetricsRegistryListener
    is just a wrapper. The wrapper’s method won’t be registered to the actual registry; instead, it’s the actual yammer’s listener which methods will be invoked. That’s why I think you want to add the method like
    void onMetricsRegistryRegistered(MetricsRegistry metricsRegistry);
    . While that’ll make the repo unclean, because we still have to pull in the actual yammer dependencies to pinot’s code. One thing I’d suggest is to initialize an actual Yammer listener and pass it as the param to the constructor.
  • j

    Jack

    03/16/2021, 8:31 PM
    this is the sample code on how to handle listener in LinkedIn (not open source), hope that will give you some idea:
    Copy code
    @Override
      public void onMetricsRegistryRegistered(final PinotMetricsRegistry metricsRegistry) {
        MetricsRegistryListener metricsRegistryListener = new MetricsRegistryListener() {
          @Override
          public void onMetricAdded(MetricName metricName, Metric metric) {
            // do sth
            }
          }
    
          @Override
          public void onMetricRemoved(MetricName metricName) {
            // do sth
          }
        };
        metricsRegistry.addListener(new YammerMetricsRegistryListener(metricsRegistryListener));
      }
  • x

    XD (Stripe)

    03/16/2021, 10:02 PM
    Thanks. I have got mine working after recompiling. Mostly it is because of Plugins are loaded in runtime by reflection, and then Plugins built agains old Pinot got loaded without any check.
  • j

    Jack

    03/16/2021, 10:04 PM
    I see. Glad that was resolved. Usually the build will fail at compile time, then we should do some changes on addressing the new code
  • d

    Davi Navarro

    10/21/2021, 4:54 AM
    @User has left the channel