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

Included http middleware to measure the graphql response times using prometheus. #1675

Merged

Conversation

naveensrinivasan
Copy link
Contributor

@naveensrinivasan naveensrinivasan commented Jan 29, 2024

Description of the PR

  • Included a HTTP middleware for measuring graphql
  • Now, every graphql request will be automatically measured and will be able to identify the duration with this additional HTTP middleware

image

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

@naveensrinivasan
Copy link
Contributor Author

Prometheus output

HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.

TYPE go_gc_duration_seconds summary

go_gc_duration_seconds{quantile="0"} 2.7584e-05
go_gc_duration_seconds{quantile="0.25"} 5.3125e-05
go_gc_duration_seconds{quantile="0.5"} 5.9208e-05
go_gc_duration_seconds{quantile="0.75"} 6.7791e-05
go_gc_duration_seconds{quantile="1"} 0.001267458
go_gc_duration_seconds_sum 0.01071615
go_gc_duration_seconds_count 140

HELP go_goroutines Number of goroutines that currently exist.

TYPE go_goroutines gauge

go_goroutines 11

HELP go_info Information about the Go environment.

TYPE go_info gauge

go_info{version="go1.21.5"} 1

HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.

TYPE go_memstats_alloc_bytes gauge

go_memstats_alloc_bytes 1.03563256e+08

HELP go_memstats_alloc_bytes_total Total number of bytes allocated, even if freed.

TYPE go_memstats_alloc_bytes_total counter

go_memstats_alloc_bytes_total 4.435398656e+09

HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.

TYPE go_memstats_buck_hash_sys_bytes gauge

go_memstats_buck_hash_sys_bytes 7465

HELP go_memstats_frees_total Total number of frees.

TYPE go_memstats_frees_total counter

go_memstats_frees_total 9.7048269e+07

HELP go_memstats_gc_sys_bytes Number of bytes used for garbage collection system metadata.

TYPE go_memstats_gc_sys_bytes gauge

go_memstats_gc_sys_bytes 8.689704e+06

HELP go_memstats_heap_alloc_bytes Number of heap bytes allocated and still in use.

TYPE go_memstats_heap_alloc_bytes gauge

go_memstats_heap_alloc_bytes 1.03563256e+08

HELP go_memstats_heap_idle_bytes Number of heap bytes waiting to be used.

TYPE go_memstats_heap_idle_bytes gauge

go_memstats_heap_idle_bytes 5.8810368e+07

HELP go_memstats_heap_inuse_bytes Number of heap bytes that are in use.

TYPE go_memstats_heap_inuse_bytes gauge

go_memstats_heap_inuse_bytes 1.41729792e+08

HELP go_memstats_heap_objects Number of allocated objects.

TYPE go_memstats_heap_objects gauge

go_memstats_heap_objects 1.349244e+06

HELP go_memstats_heap_released_bytes Number of heap bytes released to OS.

TYPE go_memstats_heap_released_bytes gauge

go_memstats_heap_released_bytes 4.2016768e+07

HELP go_memstats_heap_sys_bytes Number of heap bytes obtained from system.

TYPE go_memstats_heap_sys_bytes gauge

go_memstats_heap_sys_bytes 2.0054016e+08

HELP go_memstats_last_gc_time_seconds Number of seconds since 1970 of last garbage collection.

TYPE go_memstats_last_gc_time_seconds gauge

go_memstats_last_gc_time_seconds 1.706568490173922e+09

HELP go_memstats_lookups_total Total number of pointer lookups.

TYPE go_memstats_lookups_total counter

go_memstats_lookups_total 0

HELP go_memstats_mallocs_total Total number of mallocs.

TYPE go_memstats_mallocs_total counter

go_memstats_mallocs_total 9.8397513e+07

HELP go_memstats_mcache_inuse_bytes Number of bytes in use by mcache structures.

TYPE go_memstats_mcache_inuse_bytes gauge

go_memstats_mcache_inuse_bytes 9600

HELP go_memstats_mcache_sys_bytes Number of bytes used for mcache structures obtained from system.

TYPE go_memstats_mcache_sys_bytes gauge

go_memstats_mcache_sys_bytes 15600

HELP go_memstats_mspan_inuse_bytes Number of bytes in use by mspan structures.

TYPE go_memstats_mspan_inuse_bytes gauge

go_memstats_mspan_inuse_bytes 2.24784e+06

HELP go_memstats_mspan_sys_bytes Number of bytes used for mspan structures obtained from system.

TYPE go_memstats_mspan_sys_bytes gauge

go_memstats_mspan_sys_bytes 2.819208e+06

HELP go_memstats_next_gc_bytes Number of heap bytes when next garbage collection will take place.

TYPE go_memstats_next_gc_bytes gauge

go_memstats_next_gc_bytes 2.05939728e+08

HELP go_memstats_other_sys_bytes Number of bytes used for other system allocations.

TYPE go_memstats_other_sys_bytes gauge

go_memstats_other_sys_bytes 1.404263e+06

HELP go_memstats_stack_inuse_bytes Number of bytes in use by the stack allocator.

TYPE go_memstats_stack_inuse_bytes gauge

go_memstats_stack_inuse_bytes 786432

HELP go_memstats_stack_sys_bytes Number of bytes obtained from system for stack allocator.

TYPE go_memstats_stack_sys_bytes gauge

go_memstats_stack_sys_bytes 786432

HELP go_memstats_sys_bytes Number of bytes obtained from system.

TYPE go_memstats_sys_bytes gauge

go_memstats_sys_bytes 2.14262832e+08

HELP go_threads Number of OS threads created.

TYPE go_threads gauge

go_threads 15

HELP guacgql_http_server_request_duration_seconds Histogram of response time for handler in seconds

TYPE guacgql_http_server_request_duration_seconds histogram

guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="0.005"} 22
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="0.01"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="0.025"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="0.05"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="0.1"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="0.25"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="0.5"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="1"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="2.5"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="5"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="10"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyLegalPkgs",status_code="200",le="+Inf"} 33
guacgql_http_server_request_duration_seconds_sum{method="POST",route="CertifyLegalPkgs",status_code="200"} 0.10460274799999998
guacgql_http_server_request_duration_seconds_count{method="POST",route="CertifyLegalPkgs",status_code="200"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="0.005"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="0.01"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="0.025"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="0.05"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="0.1"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="0.25"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="0.5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="1"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="2.5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="10"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="CertifyScorecards",status_code="200",le="+Inf"} 8
guacgql_http_server_request_duration_seconds_sum{method="POST",route="CertifyScorecards",status_code="200"} 0.000881791
guacgql_http_server_request_duration_seconds_count{method="POST",route="CertifyScorecards",status_code="200"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="0.005"} 22
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="0.01"} 32
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="0.025"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="0.05"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="0.1"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="0.25"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="0.5"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="1"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="2.5"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="5"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="10"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasMetadataPkgs",status_code="200",le="+Inf"} 33
guacgql_http_server_request_duration_seconds_sum{method="POST",route="HasMetadataPkgs",status_code="200"} 0.11246920400000002
guacgql_http_server_request_duration_seconds_count{method="POST",route="HasMetadataPkgs",status_code="200"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="0.005"} 18
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="0.01"} 43
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="0.025"} 50
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="0.05"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="0.1"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="0.25"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="0.5"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="1"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="2.5"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="5"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="10"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="HasSBOMPkgs",status_code="200",le="+Inf"} 51
guacgql_http_server_request_duration_seconds_sum{method="POST",route="HasSBOMPkgs",status_code="200"} 0.29569775100000006
guacgql_http_server_request_duration_seconds_count{method="POST",route="HasSBOMPkgs",status_code="200"} 51
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="0.005"} 126
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="0.01"} 132
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="0.025"} 133
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="0.05"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="0.1"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="0.25"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="0.5"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="1"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="2.5"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="5"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="10"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestArtifacts",status_code="200",le="+Inf"} 134
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IngestArtifacts",status_code="200"} 0.206359384
guacgql_http_server_request_duration_seconds_count{method="POST",route="IngestArtifacts",status_code="200"} 134
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="0.005"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="0.01"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="0.025"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="0.05"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="0.1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="0.25"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="0.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="2.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="10"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestBuilders",status_code="200",le="+Inf"} 67
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IngestBuilders",status_code="200"} 0.002269371000000001
guacgql_http_server_request_duration_seconds_count{method="POST",route="IngestBuilders",status_code="200"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="0.005"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="0.01"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="0.025"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="0.05"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="0.1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="0.25"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="0.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="2.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="10"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestLicenses",status_code="200",le="+Inf"} 67
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IngestLicenses",status_code="200"} 0.0038279979999999996
guacgql_http_server_request_duration_seconds_count{method="POST",route="IngestLicenses",status_code="200"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="0.005"} 31
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="0.01"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="0.025"} 59
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="0.05"} 66
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="0.1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="0.25"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="0.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="2.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="10"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestPackages",status_code="200",le="+Inf"} 67
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IngestPackages",status_code="200"} 0.7888799190000002
guacgql_http_server_request_duration_seconds_count{method="POST",route="IngestPackages",status_code="200"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="0.005"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="0.01"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="0.025"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="0.05"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="0.1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="0.25"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="0.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="2.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="10"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestSources",status_code="200",le="+Inf"} 67
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IngestSources",status_code="200"} 0.004201205
guacgql_http_server_request_duration_seconds_count{method="POST",route="IngestSources",status_code="200"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="0.005"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="0.01"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="0.025"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="0.05"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="0.1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="0.25"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="0.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="1"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="2.5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="5"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="10"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IngestVulnerabilities",status_code="200",le="+Inf"} 67
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IngestVulnerabilities",status_code="200"} 0.0021633310000000005
guacgql_http_server_request_duration_seconds_count{method="POST",route="IngestVulnerabilities",status_code="200"} 67
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="0.005"} 30
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="0.01"} 44
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="0.025"} 49
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="0.05"} 69
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="0.1"} 76
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="0.25"} 82
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="0.5"} 83
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="1"} 83
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="2.5"} 83
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="5"} 83
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="10"} 83
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsDependencies",status_code="200",le="+Inf"} 83
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IsDependencies",status_code="200"} 2.7421167889999993
guacgql_http_server_request_duration_seconds_count{method="POST",route="IsDependencies",status_code="200"} 83
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="0.005"} 0
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="0.01"} 0
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="0.025"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="0.05"} 33
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="0.1"} 40
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="0.25"} 41
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="0.5"} 41
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="1"} 41
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="2.5"} 41
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="5"} 41
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="10"} 41
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesPkg",status_code="200",le="+Inf"} 41
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IsOccurrencesPkg",status_code="200"} 1.804438753
guacgql_http_server_request_duration_seconds_count{method="POST",route="IsOccurrencesPkg",status_code="200"} 41
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="0.005"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="0.01"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="0.025"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="0.05"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="0.1"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="0.25"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="0.5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="1"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="2.5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="10"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="IsOccurrencesSrc",status_code="200",le="+Inf"} 8
guacgql_http_server_request_duration_seconds_sum{method="POST",route="IsOccurrencesSrc",status_code="200"} 0.000623416
guacgql_http_server_request_duration_seconds_count{method="POST",route="IsOccurrencesSrc",status_code="200"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="0.005"} 0
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="0.01"} 0
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="0.025"} 0
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="0.05"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="0.1"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="0.25"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="0.5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="1"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="2.5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="5"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="10"} 8
guacgql_http_server_request_duration_seconds_bucket{method="POST",route="SLSAForArtifacts",status_code="200",le="+Inf"} 8
guacgql_http_server_request_duration_seconds_sum{method="POST",route="SLSAForArtifacts",status_code="200"} 0.22150658400000003
guacgql_http_server_request_duration_seconds_count{method="POST",route="SLSAForArtifacts",status_code="200"} 8

cmd/guacgql/cmd/server.go Outdated Show resolved Hide resolved
cmd/guacgql/cmd/server.go Outdated Show resolved Hide resolved
pkg/metrics/prometheus.go Outdated Show resolved Hide resolved
@lumjjb
Copy link
Contributor

lumjjb commented Feb 5, 2024

@sunnyyip would like your input on this!!

Copy link
Collaborator

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

small nit, LTGM

pkg/metrics/prometheus.go Outdated Show resolved Hide resolved
@pxp928
Copy link
Collaborator

pxp928 commented Feb 15, 2024

@sunnyyip would like your input on this!!

@lumjjb Sunny took a look and we are ready to proceed with this PR

@pxp928 pxp928 requested a review from lumjjb February 15, 2024 13:59
@pxp928 pxp928 added the needs-review Needs writer LGTM label Feb 15, 2024
- Included http handler for measuring graphql

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
@sunnyyip
Copy link
Collaborator

All looks good...the only comment I have is that we should probably use millisecond as unit for response time metric.

@kodiakhq kodiakhq bot merged commit e2c8157 into guacsec:main Feb 23, 2024
8 checks passed
@naveensrinivasan naveensrinivasan deleted the naveen/graphql/prometheus-metrics branch February 23, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review Needs writer LGTM size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants