Commit Graph
32 Commits
Author SHA1 Message Date
Aditya SharmaandJohan Brandhorst-Satzkorn 30e3116156 Add parsing logic for User-Agent headers (#5645)
* feat(ts_telemetry): add parsing logic for user agent headers

* feat(ts_telemetry): update gRPC observability for user-agent headers

* feat(ts_telemetry): add observation tags

* feat(ts_telemetry): Resolved comments

* feat(ts_telemetry): Removed loop variable capture

* feat(ts_telemetry): Updated userAgentKey to be inline

* feat(ts_telemetry): Add support for userAgent as per RFC 9110

* feat(ts_telemetry): Resolved comments

* Fix newline

* feat(ts_telemetry): Moved user-agent parsing to interceptor

* feat(ts_telemetry): Added user-agent parsing complex test case

* Update userAgentsKey comment

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>

* feat(ts_telemetry): Updated changelog

* feat(ts_telemetry): Resolved comments

---------

Co-authored-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2025-04-17 23:46:25 +05:30
Johan Brandhorst-SatzkornandDamian Debkowski ec0a3f964b Worker status refactor (#5417)
* oss: feat(proto): statistics rpc added to server coordination service

* oss: feat(session): add update statistics status service

* oss: feat(handlers): add Statistics method to worker service server

* oss: feat(worker): add statistics ticking

* oss: internal/proto: define the new RoutingInfo RPC

* oss: internal/server: repository changes for RoutingInfo RPC

* oss: internal/daemon: add RoutingInfo handler to worker service

The new RoutingInfo RPC is used to get information from the worker
that is used to make routing decisions on the controller. It also
handles the initial request from the worker.

* oss: feat(db): server_worker_session_info table

* oss: feat(proto): session info rpc for server coordination service

* oss: feat(server): worker session info request data type

* oss: feat(worker): session info ticker

* oss: feat(handler): server coordination handler for session info

* oss: feat(session): utilize session info request time for session cleanup

* oss: proto: fix some gotags comments

Some of these fields were missing comments, while others had
incorrectly formatted comments.

* oss: worker: send connection status to server

This is required for the correct tracking of orphaned connections

* oss: internal/daemon/worker: add function to wait for Statistics RPC

* oss: internal/daemon/worker: add routing info RPC

The new RoutingInfo RPC replaces part of the Status RPC,
namely the part which is used by the controller and worker
to perform decisions around the establishment of new sessions
and new worker connections.

* oss: internal/daemon/worker: remove unnecessary error check

* oss: internal/daemon/worker: lock access to config and upstreams

The new confLock protects access to the conf value and to the
addressReceivers slice.

* oss: worker: replace Status RPC with RoutingInfo

* oss: worker: deprecate the Status RPC and related types

The Status RPC and related messages have been replaced
by the RoutingInfo/SessionInfo/Statistics RPCs. The controller
will continue to support the Status RPC until two new minor
versions have been released.

* oss: internal/event: add default deny for new worker RPCs

* oss: internal/daemon/worker: allow RPC interval to be set

The new SessionInfo/RoutingInfo/Statistics RPCs run at
long intervals, which make some of our cluster tests take
a long time to complete. This allows their interval to be
configured in tests.

* oss: all: use TestWorkerRPCInterval in slow tests

This should speed up these tests significantly.

* oss: internal/tests/cluster: reset sys eventer in test

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2025-01-09 10:26:37 -08:00
Johan Brandhorst-Satzkorn 1cbe1ca463 internal/event: fix log processor race (#5401)
The cloud events formatter Process function would call
the signer without protecting it, which was racy with the Rotate
function.
2025-01-07 09:11:52 -08:00
Johan Brandhorst-Satzkorn c85fad27f6 internal/event: avoid reusing canceled context (#5304)
Don't error in ReleaseGate if the context used for the original
event has been cancelled. Any error in ReleaseGate causes the
controller to terminate its startup. If a user was trying to send
a request to the Boundary controller as it started up, the context
tied to the request would be reused to attempt logging the
observation associated with the request after the logging gate
was released. This would always fail, as the context associated
with the request was canceled.

We now use a new context timeout for events logged after the release
gate is released, if the original context was canceled.
2024-12-04 09:50:25 -08:00
Hugo 22b54c8b97 fix(event): Prevent eventer data races by removing shallow object copy (#5139)
This issue was surfaced through other changes (PR 5137).

Given that the eventer works in a singleton pattern (see sysEventer
global variable), performing this shallow object copy can cause a data
race because the copy operation reads the underlying eventer data
structures. At the same time, given the global nature of this eventer,
other goroutines can be writing to those same data structures.

Since we're already using a singleton pattern in this package, and given
that the current copy operation is shallow, copying the object doesn't
seem necessary, so this commit changes `StandardWriter` to build the
`logAdapter` with the `e` eventer directly instead of copying it.
2024-09-30 12:17:56 -07:00
Damian Debkowski 9576ed40dc test: improve test to ensure ipv6 compatability (#5113) 2024-09-19 08:55:27 -07:00
Sorawis Nilparuk (Bo) 8f457c9c93 make newSendCtx also handle context.DeadlineExceeded (#4603)
* make newSendCtx also handle context.DeadlineExceeded

* add assertion to check that context is valid
2024-04-19 09:23:40 -07:00
Irena Rindos 0160258bb5 bug: fix data race in hclogger (#4645)
* bug: fix data race in hclogger
2024-04-17 14:53:24 -04:00
Louis Ruch c376d06355 feat: Add support for correlationId 2024-04-11 09:08:45 -07:00
Elim Tsiagbey 3f94c900f0 feat: Add worker event listener
- add worker event listener
- add worker event handler
- start event listener when a worker starts
2024-04-05 16:46:22 -04:00
Jeff MitchellandDamian Debkowski 014a5a7aae Vet/race fixes (#4421)
This addresses all found vet/race fixes in community edition.

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2024-02-21 16:32:26 -05:00
Jeff MitchellandDamian Debkowski 35cef97bd4 Linter fixes PR 3 (#4415)
* Linter fixes

* fix(bsr): update test to register TEST protocol once

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
2024-02-16 08:30:16 -05:00
Jeff Mitchell 25bce9e8ff Fix linter warnings 2024-02-13 15:50:11 -05:00
Sepehr 5c84a8861a Observation(event): adding op instead of type details paylaod (#4043)
* Observation(event): adding op instead of type details paylaod

* Observation(events): removing op check in details
2023-11-15 13:03:04 -08:00
Sepehr 4dce290aeb telemetry(observations): fix the details flag check (#3960)
* telemetry(observations): fix the details flag check

* telemetry(observations): fix the test names
2023-10-31 09:53:49 -07:00
April Ayres f13a23eab7 fix (telemetry): ignore fields without public class 2023-09-22 14:15:23 -07:00
Sepehr 14b3237a69 fix (telemetry): filtering events: fix default deny filter behavior 2023-09-22 11:31:42 -04:00
Sepehr 167161448b Add write observation interceptors, add validation check, fix default deny filter 2023-09-22 11:31:42 -04:00
April Ayres 0216c51ffc (telemetry_filter): handle map / slice traversals of proto structs 2023-09-22 11:31:42 -04:00
April Ayres ee7c17d2dc (event_observation): use consts for request/response, code cleanup 2023-09-22 11:31:42 -04:00
April Ayres c7cd6eabf3 (telemetry_filter): handle core proto types atomically 2023-09-22 11:31:42 -04:00
Sepehr 41c1e79cad observation(event): add workers list test 2023-09-22 11:31:42 -04:00
April Ayres 49a1563f6a observation(event): refine telemetry filter, and WithTelemetry() 2023-09-22 11:31:42 -04:00
Sepehr fcb29ed919 observation(event): add req/resp to observations and recursively scan observation tags 2023-09-22 11:31:42 -04:00
Sepehr e278964422 observability(events): Adding telemetry flag and and telemetry sink event type with tests 2023-09-22 11:31:42 -04:00
Irena Rindos 8a0b8d84d8 feat(event): remove node on pipeline failure (#3736) 2023-09-20 10:19:26 -04:00
Jim 0d19892e03 fix (events): convert multierror to stdlib error (#3743)
* fix (events): convert multierror to stdlib error

multierror errors will be converted to a stdlib error (because
multierror doesn't support json marshaling).

* refact (errors): convert from multierror to stdlib errors.Join(...)

* refact: convert from pkg/errors to stdlib error wrapping
2023-09-17 19:35:43 -04:00
Irena Rindos bf595f8599 feat(events): add deregister pipeline (#3729)
* feat(events): add deregister pipeline
2023-09-14 16:06:10 -04:00
Damian Debkowski e3e848d847 feat(event): new storage event type (#3719) 2023-09-14 10:31:01 -07:00
Irena Rindos 6161635f65 feat(event): add register pipeline (#3714) 2023-09-13 13:08:16 -04:00
Irena Rindos 6f10a0ac87 chore: update go-eventlogger (#3707)
* chore: update go-eventlogger
2023-09-12 11:03:18 -04:00
Irena Rindos 9733a250fa refact(event): move observability/event to event (#3704) 2023-09-12 08:15:34 -04:00