Skip to content

Disable within a request using modulesΒ #17

@michaelbrewerdavis

Description

@michaelbrewerdavis

I might be missing something, but I don't see a way to use environment variables to disable sending to honeycomb (e.g. for a dev environment).

const honeycombConfig: HoneycombConfig = {}

const module = {
  async fetch(request: Request, env: any, context: ExecutionContext) {
    return await handleRequest(request, env);
  },
};

export default wrapModule(honeycombConfig, module);

As I undestand it, modules put environment variables in the env argument, so they're not accessible at the time of wrapModule(). The ability to specify HONEYCOMB_DATASET and HONEYCOMB_API_KEY as env vars means we don't end up adding data, but we do still end up making requests to honeycomb.

A couple possibilities:

  • add an env var to disable
  • add a config key to disable and
    -- merge env with HoneycombConfig as we resolve configs, or
    -- make more config keys overridable with env vars

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions