Skip to content

Convert public API to builder pattern #17

Description

@mcasper

Trying to provide a clean API that has lots of optional fields is pretty verbose right now, as was made clear by service checks, not to mention all the options that events support that we should add. My thought is to transition the API to more of a builder pattern, so that you never have to specify the optional arguments that you don't care about:

client.service_check("redis.can_connect", ServiceStatus::OK)
    .hostname("my-host.localhost")
    .timestamp(1510327616)
    .send()

or

client.gauge("my_gauge", "12345")
    .tag("special:tag")
    .send()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions