Skip to content

Custom httpclient support #88

@chou-godaddy

Description

@chou-godaddy

Problem

I need to push metrics that requires mutual TLS authentication with client certificates. The current implementation in push.go uses a private HTTP client that can't be customized from outside the package.

This creates a dilemma:

  1. Either modify the global HTTP DefaultTransport (which affects all HTTP clients in the application)
  2. Or create a custom pusher with a custom HTTP client with specific TLS configuration

Question

Has anyone else needed to push metrics to the storage endpoint requiring client certificates or custom TLS configurations? How have you solved this problem?

Potential Solutions

I see a few possible ways to address this:

  1. Add a CustomClient field to the existing PushOptions struct
  2. Create new functions that accept a custom HTTP client

I'd appreciate any guidance on the best approach that aligns with the project's design philosophy before submitting a pull request.

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