Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracing and metrics (prometheus/jaeger/...) capabilities #463

Closed
4 tasks
zepatrik opened this issue Mar 1, 2021 · 1 comment · Fixed by #536
Closed
4 tasks

Add tracing and metrics (prometheus/jaeger/...) capabilities #463

zepatrik opened this issue Mar 1, 2021 · 1 comment · Fixed by #536
Assignees
Labels
feat New feature or request. good first issue A good issue to tackle when being a novice to the project.

Comments

@zepatrik
Copy link
Member

zepatrik commented Mar 1, 2021

Is your feature request related to a problem? Please describe.

Currently there is no tracing middleware loaded.

Describe the solution you'd like

Instantiation of the servers:

  • func (r *RegistryDefault) ReadGRPCServer() *grpc.Server {
    s := grpc.NewServer(
    grpc.StreamInterceptor(
    grpcMiddleware.ChainStreamServer(
    grpc_logrus.StreamServerInterceptor(r.l.Entry),
    ),
    ),
    grpc.UnaryInterceptor(
    grpcMiddleware.ChainUnaryServer(
    grpc_logrus.UnaryServerInterceptor(r.l.Entry),
    ),
    ),
    )
  • func (r *RegistryDefault) WriteGRPCServer() *grpc.Server {
    s := grpc.NewServer(
    grpc.StreamInterceptor(
    grpcMiddleware.ChainStreamServer(
    grpc_logrus.StreamServerInterceptor(r.l.Entry),
    ),
    ),
    grpc.UnaryInterceptor(
    grpcMiddleware.ChainUnaryServer(
    grpc_logrus.UnaryServerInterceptor(r.l.Entry),
    ),
    ),
    )
  • func (r *RegistryDefault) WriteRouter() http.Handler {
    n := negroni.New(reqlog.NewMiddlewareFromLogger(r.l, "write#Ory Keto"))
  • func (r *RegistryDefault) ReadRouter() http.Handler {
    n := negroni.New(reqlog.NewMiddlewareFromLogger(r.l, "write#Ory Keto"))

Additional context

Kratos' prometheus endpoint implementation: https://github.com/ory/kratos/tree/master/metrics/prometheus
Other tracing options in Kratos can be found here: https://github.com/ory/kratos/blob/412af90a9cc86cb3b2fd8059b6fa51d640b23c05/driver/config/config.go

@zepatrik zepatrik added feat New feature or request. good first issue A good issue to tackle when being a novice to the project. labels Mar 1, 2021
@aeneasr
Copy link
Member

aeneasr commented Mar 1, 2021

@zepatrik jaeger and prometheus are doing two separate things:

  • Jaeger enables tracing - including tracing is very easy, you can check the source code (especially SQL init) from hydra/kratos and just copy paste that
  • Prometheus enables metrics - including is also very easy as there are already available metricsx packages in x available (you can also refer to hydra for that!)

Enjoy :)

@zepatrik zepatrik changed the title Add tracing (prometheus/jaeger/...) capabilities Add tracing and metrics (prometheus/jaeger/...) capabilities Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request. good first issue A good issue to tackle when being a novice to the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants