Skip to content

grpc: add request related metrics#4811

Merged
MrAnno merged 5 commits intosyslog-ng:masterfrom
alltilla:grpc-request-metrics
Feb 6, 2024
Merged

grpc: add request related metrics#4811
MrAnno merged 5 commits intosyslog-ng:masterfrom
alltilla:grpc-request-metrics

Conversation

@alltilla
Copy link
Collaborator

@alltilla alltilla commented Feb 1, 2024

Implementing this with composition in each gRPC related dest driver is suboptimal.

The clean thing would be to have a common gRPC related dest driver, which already does handle metrics, and the otel, bigquery and loki drivers should descend from it. Unfortunately doing that would be a huge task right now.

IMO this should suffice for now, but we should really clean up the class hierarchy sometime later.


Affected drivers:

  • opentelemetry()
  • syslog-ng-otlp()
  • bigquery()
  • loki()

Example metrics:

syslogng_output_grpc_requests_total{driver="syslog-ng-otlp",url="localhost:12345",response_code="ok"} 49
syslogng_output_grpc_requests_total{driver="syslog-ng-otlp",url="localhost:12345",response_code="unavailable"} 11

@bazsi
Copy link
Collaborator

bazsi commented Feb 4, 2024

I reviewed the code and it looks good to me. Just one question: this registers all the counters at startup, unlike http (I think), which only registers them if they are encountered.

would it be possible to defer the registration, so we don't have to collect all these metrics unless they are actually non-zero?

Copy link
Collaborator

@MrAnno MrAnno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

alltilla added a commit to alltilla/syslog-ng that referenced this pull request Feb 5, 2024
Signed-off-by: Attila Szakacs <[email protected]>
@alltilla alltilla force-pushed the grpc-request-metrics branch from 7a2138d to a653d19 Compare February 5, 2024 11:41
@alltilla
Copy link
Collaborator Author

alltilla commented Feb 5, 2024

@bazsi Yes, I implemented that in the latest iteration.

Iimplementing this with composition in each gRPC related dest
driver is suboptimal.

The clean thing would be to have a common gRPC related dest driver,
which already does handles metrics, and the otel, bigquery and loki
drivers should descend from it. Unfortunately doing that would be a
huge task right now.

IMO this should suffice for now, but we should really clean up
the class hierarchy sometime later.

Signed-off-by: Attila Szakacs <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]>
@alltilla alltilla force-pushed the grpc-request-metrics branch from a653d19 to 4935ddc Compare February 5, 2024 12:50
alltilla added a commit to alltilla/syslog-ng that referenced this pull request Feb 5, 2024
Signed-off-by: Attila Szakacs <[email protected]>
@MrAnno MrAnno merged commit 1276338 into syslog-ng:master Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants