Skip to content

Adds stateless/stateful registries#78

Merged
dmuino merged 1 commit intoNetflix:spectatordfrom
dmuino:s2
Oct 6, 2020
Merged

Adds stateless/stateful registries#78
dmuino merged 1 commit intoNetflix:spectatordfrom
dmuino:s2

Conversation

@dmuino
Copy link
Copy Markdown
Contributor

@dmuino dmuino commented Oct 6, 2020

A stateless registry is usually used in conjunction with spectatord and
does not require to keep state on the current process. Tests done by
users of this library are greatly simplified if the registry and meters
can be queried though, therefore requiring some local state.

This change adds a way to compose whether the registry will be
stateless/stateful and which publisher will be used to send all updates
in the stateless case.

A stateless registry is usually used in conjunction with spectatord and
does not require to keep state on the current process. Tests done by
users of this library are greatly simplified if the registry and meters
can be queried though, therefore requiring some local state.

This change adds a way to compose whether the registry will be
stateless/stateful and which publisher will be used to send all updates
in the stateless case.
@dmuino dmuino merged commit c172bff into Netflix:spectatord Oct 6, 2020
@dmuino dmuino deleted the s2 branch October 6, 2020 22:57
copperlight added a commit that referenced this pull request Dec 2, 2022
* Use spectatord (#77)

Switches from implementing a stateful registry to a registry that sends
all acitivity to a spectatord sidecar. The build only supports bazel
now, and we add a dependency on abseil and asio (removing the
curl/cares/rapidjson/boringssl, etc. dependencies)

* Adds stateless/stateful registries (#78)

A stateless registry is usually used in conjunction with spectatord and
does not require to keep state on the current process. Tests done by
users of this library are greatly simplified if the registry and meters
can be queried though, therefore requiring some local state.

This change adds a way to compose whether the registry will be
stateless/stateful and which publisher will be used to send all updates
in the stateless case.

* Allow the user to pass a logger (#79)

This can be used to customize the verbosity of the spectator logger by
user programs.

Deletes unused source file: registry.cc

* Allow the user to pass a logger (#80)

This can be used to customize the verbosity of the spectator logger by
user programs.

Deletes unused source file: registry.cc

* Update to new spectatord format (#81)

Spectatord payload expects name,tags now instead of name:#tags

* Remove unused files (#82)

These were left due to some merging issue in previous PRs. They're no
longer used.

* Reconnect on errors (#83)


Reconnect when there are errors. Particularly important in the local
socket case where if the daemon becomes unavailable we must re-establish
the connection otherwise all future updates would be lost.

* Support common_tags (#84)

These are tags that will be added to all Ids when they're created using
the registry. This is used for example in the system agents to tag all
metrics with xatlas.process.

* Fix sender when no valid endpoint is configured (#85)

This fixes a problem when the endpoint configured was not valid (i.e.
did not start with `unix:` or `udp:`, and we would end up throwing an
exception due to publisher::sender not being initialized.

* Switch std::string_view to absl::string_view to avoid implicit conversion

Co-authored-by: Daniel Muino <dmuino@users.noreply.github.com>
Co-authored-by: James Mulcahy <jmulcahy@netflix.com>
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.

1 participant