Commit graph

89 commits

Author SHA1 Message Date
Kenneth Jenkins
b188a168af
metrics: fix an apparent metric setup error (#5543)
The IdentityManagerLastSessionRefreshErrorView appears to be a duplicate
of IdentityManagerLastUserRefreshErrorView. Adjust it to use the
matching identityManagerLastSessionRefreshError instead.
2025-03-25 14:48:07 -07:00
Joe Kralicky
a96ab2fe93
move internal/telemetry/trace => pkg/telemetry/trace (#5541) 2025-03-25 10:43:04 -04:00
Joe Kralicky
8c6955dbe2
Increase some test timeouts (#5535)
increase some test timeouts
2025-03-19 14:52:11 -04:00
Denis Mishin
5ef16bcd28
metrics: reduce gc pressure (#5530) 2025-03-18 13:48:49 -04:00
Caleb Doxsey
932db70d96
remove noisy logs (#5501) 2025-02-26 10:31:12 -07:00
Joe Kralicky
3043e98fab
Fix trace client update (#5480) 2025-02-12 19:47:17 -05:00
Joe Kralicky
c8323ba744
tracing: handle empty protocol (#5474) 2025-02-06 13:19:50 -05:00
Joe Kralicky
5e94b2f8f1
Refactor trace config to match supported otel options (#5447)
* Refactor trace config to match supported otel options

* use duration instead of int64 for otel timeouts

* change 'trace client updated' log level to debug
2025-01-30 11:59:19 -05:00
Joe Kralicky
c307ca806a
fix testcontainers docker client using the global tracer provider (#5440) 2025-01-24 14:55:21 -05:00
Joe Kralicky
6ea51149f9
tracing: adjust envoy otel trace batching settings to match go sdk (#5446) 2025-01-24 14:51:07 -05:00
Joe Kralicky
b674d5c19d
Fix small timeout causing test flake (#5436) 2025-01-21 14:31:34 -05:00
Joe Kralicky
396c35b6b4
New tracing system (#5388)
* update tracing config definitions

* new tracing system

* performance improvements

* only configure tracing in envoy if it is enabled in pomerium

* [tracing] refactor to use custom extension for trace id editing (#5420)

refactor to use custom extension for trace id editing

* set default tracing sample rate to 1.0

* fix proxy service http middleware

* improve some existing auth related traces

* test fixes

* bump envoyproxy/go-control-plane

* code cleanup

* test fixes

* Fix missing spans for well-known endpoints

* import extension apis from pomerium/envoy-custom
2025-01-21 13:26:32 -05:00
Kenneth Jenkins
247cd175fe
metrics: restore global registry in unit tests (#5399)
Currently there appears to be a test order dependency between a couple
of the info_test.go test cases and the Test_PrometheusHandler test. This
can be exposed by running:

  go test -count 2 ./internal/telemetry/metrics

The test cases in info_test.go overwrite the global 'registry' variable,
which seems to prevent Test_PrometheusHandler from being able to export
the internal Go metrics. Add a helper method to restore the original
registry after these test cases.
2024-12-18 13:21:06 -08:00
Kenneth Jenkins
69cb6f53de
metrics: make sure to flush buffered writer (#5398)
The writeMetricsMux() method instantiates a buffered writer but does not
call Flush() after it is done writing. As a result the metrics output
may be incomplete.
2024-12-18 12:50:12 -08:00
Denis Mishin
699679bc57
core/metrics: improve memory usage (#5364) 2024-12-03 11:17:34 -05:00
Caleb Doxsey
d2c14cd6d2
logging: remove ctx from global log methods (#5337)
* log: remove warn

* log: update debug

* log: update info

* remove level, log

* remove contextLogger function
2024-10-23 14:18:52 -06:00
Caleb Doxsey
dad954ae16
core/logging: change log.Error function (#5251)
* core/logging: change log.Error function

* use request id
2024-09-05 15:42:46 -06:00
Caleb Doxsey
d062f9d68d
core/logs: remove warnings (#5235)
* core/logs: remove warnings

* switch to error
2024-08-27 09:38:50 -06:00
Joe Kralicky
8001077706
Update to Go 1.23 (#5216)
* Update to Go 1.23

* Update golangci-lint-action

* Fix new errors from updated linter

* Bump golangci-lint to v1.60.1
2024-08-14 14:12:01 -04:00
Denis Mishin
c1dec06afa
zero/telemetry: internal envoy stats scraper and metrics producer (#5136) 2024-06-16 20:41:05 -04:00
Denis Mishin
2b1dcf7355
telemetry: add prometheus streaming converter to OTLP (#5132) 2024-06-10 15:39:09 -04:00
Joe Kralicky
927f24e1ff
Envoy resource monitoring & overload manager configuration (#5106)
* Initial envoy cgroup resource monitor implementation

* Add cgroupv1 support; add metrics instrumentation

* Slight refactor for more efficient memory limit detection

Instead of reading memory.max/limit_in_bytes on every tick, we
read it once, then again only when it is modified.

To support this change, logic for computing the saturation was moved out
of the cgroup driver and into the resource monitor, and the driver
interface now has separate methods for reading memory usage and limit.

* Code cleanup/lint fixes

* Add platform build tags

* Add unit tests

* Fix lint issues

* Add runtime flag to allow disabling resource monitor

* Clamp saturation values to the range [0.0, 1.0]

* Switch to x/sys/unix; handle inotify IN_IGNORED events
2024-05-28 16:57:09 -04:00
Caleb Doxsey
1a5b8b606f
core/lint: upgrade golangci-lint, replace interface{} with any (#5099)
* core/lint: upgrade golangci-lint, replace interface{} with any

* regen proto
2024-05-02 14:33:52 -06:00
Caleb Doxsey
4301da3648
core/telemetry: move requestid to pkg directory (#4911) 2024-01-19 13:18:16 -07:00
Caleb Doxsey
a2fd95aae6
core/ci: update linting (#4844)
* core/ci: update linting

* re-add exportloopref

* re-add gocheckcompilerdirectives

* re-add stylecheck

* re-add usestdlibvars

* upgrade lint

---------

Co-authored-by: Denis Mishin <dmishin@pomerium.com>
2023-12-14 09:07:54 -08:00
Kenneth Jenkins
a246466a87
metrics: explicitly set Accept header (#4774)
If a request is made to the Pomerium metrics endpoint with an Accept
header requesting the Prometheus protobuf exposition format, some
metrics will be missing from the response.

These missing metrics are obtained by replaying the incoming request to 
an OpenCensus metrics exporter. This exporter honors the request for the
protobuf format, however Pomerium expects this response to be in the 
text format.

We can avoid this mismatch by explicitly requesting the text format from
the OpenCensus exporter, regardless of the incoming request's Accept
header.

(Note: the Pomerium metrics endpoint always responds with text format 
metrics, even if the protobuf format is requested.)
2023-11-30 16:14:24 -08:00
Caleb Doxsey
bcddbff6e1
core/redis: remove redis (#4768)
* core/redis: remove redis

* 20 minute max wait
2023-11-28 13:14:36 -07:00
Sylvain Rabot
7211a8d819
Add metric request error in log (#4585)
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2023-09-21 15:29:35 -06:00
Caleb Doxsey
bbed421cd8
config: remove source, remove deadcode, fix linting issues (#4118)
* remove source, remove deadcode, fix linting issues

* use github action for lint

* fix missing envoy
2023-04-21 17:25:11 -06:00
Caleb Doxsey
daed2d260c
config: disable envoy admin by default, expose stats via envoy route (#3677) 2022-10-18 16:25:03 -06:00
dependabot[bot]
f253365470
chore(deps): bump github.com/golangci/golangci-lint from 1.47.2 to 1.47.3 (#3522)
* chore(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.47.2 to 1.47.3.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.47.2...v1.47.3)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix linting issues

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
2022-08-05 13:45:12 -06:00
Caleb Doxsey
89a105c8e6
authorize: add request id to context (#3497)
* authorize: add request id to context

* fix context keys
2022-07-26 14:34:48 -06:00
Denis Mishin
f67b33484b
add metrics aggregation (#3452) 2022-06-30 10:52:45 -04:00
Denis Mishin
db426072b0
eliminate global events manager (#3422) 2022-06-14 15:05:16 -04:00
Denis Mishin
ac9e086691
last known metric error (#2974) 2022-01-31 12:35:51 -05:00
cfanbo
84dad4c612
remove deprecated ioutil usages (#2877)
* fix: Fixed return description error

* config/options: Adjust the position of TracingJaegerAgentEndpoint option

* DOCS: Remove duplicate configuration items

Remove duplicate configuration items of route

* remove deprecated ioutil usages
2021-12-30 10:02:12 -08:00
Denis Mishin
c19dd80fe6
more idp metrics (#2842) 2021-12-22 17:30:16 -05:00
Travis Groth
54ec88fb93
internal/telemetry: fix grpc server stats (#2811) 2021-12-08 16:13:08 -05:00
Travis Groth
e2e0646f70
Fix IdP client metrics (#2810) 2021-12-08 13:22:53 -05:00
Caleb Doxsey
500405512f
dependencies: vendor base58, remove shortuuid (#2739)
* vendor base58

* remove shortuuid
2021-11-02 09:23:15 -06:00
Caleb Doxsey
62d6ce8507
telemetry: improve zipkin error logs (#2710) 2021-10-26 14:43:43 -06:00
Caleb Doxsey
fbf44261c1
telemetry: support b3 headers on gRPC server calls (#2376) 2021-07-20 05:36:58 -06:00
Caleb Doxsey
fcb33966e2
config: add enable_google_cloud_serverless_authentication to config protobuf (#2306)
* config: add enable_google_cloud_serverless_authentication to config protobuf

* use dependency injection for embedded envoy provider

* Revert "use dependency injection for embedded envoy provider"

This reverts commit 5c08990501.

* config: attach envoy version to Config to avoid metrics depending on envoy/files
2021-06-21 18:00:29 -06:00
Caleb Doxsey
31fa214983
envoy: add full version (#2287)
* envoy: add full version

* remove unused import

* get envoy for lint
2021-06-14 13:58:12 -06:00
Caleb Doxsey
513859665a
tracing: support dynamic reloading, more aggressive envoy restart (#2262)
* tracing: support dynamic reloading, more aggressive envoy restart

* set exporter to nil

* actually register tracer
2021-06-02 09:58:07 -06:00
wasaga
1ac93c2d3a
telemetry: add hostname tag to metrics (#2191) 2021-05-11 17:58:02 -04:00
wasaga
e0c09a0998
log context (#2107) 2021-04-22 10:58:13 -04:00
wasaga
a935c1ba30
config related metrics (#2065) 2021-04-07 12:29:36 -07:00
Caleb Doxsey
4cc697ace4
autocert: add metrics for renewal count, total and next expiration (#2019) 2021-03-25 08:03:04 -06:00
Caleb Doxsey
e2ebef44ef
telemetry: add installation id (#2017)
* telemetry: add installation id

* set installation id globally

* remove unneeded changes
2021-03-24 07:22:54 -06:00