Skip to content

instana/instana-go-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instana Go Client Library

Go Version License Build Status

A comprehensive Go client library for the Instana API. This library provides a clean, idiomatic Go interface for interacting with Instana's monitoring and observability platform.

Installation

go get github.com/instana/instana-go-client

Quick Start

Configuration Methods

1. Simple Client Creation

    // Create client with basic configuration
    api := instana.NewInstanaAPIWithUserAgent(
        "your-api-token",
        "your-tenant.instana.io",
        false, // skipTlsVerification
        "terraform/6.0.0",
    )
    
    // Use the client...
    channel, err := api.AlertingChannels().GetOne("id")

    if err != nil {
        log.Fatal(err)
    }
    
    fmt.Printf("Channel Name: %s\n", channel.Name)

2. Builder Pattern

    config, err := config.NewConfigBuilder().
        WithBaseURL("https://tenant-unit.instana.io").
        WithAPIToken("your-api-token").
        WithConnectionTimeout(45 * time.Second).
        WithRequestTimeout(90 * time.Second).
        WithMaxRetryAttempts(5).
        WithRetryInitialDelay(2 * time.Second).
        WithRateLimitRequestsPerSecond(50).
        WithCustomHeader("X-Custom-Header", "value").
        WithDebug(true).
        Build()

    if err != nil {
        log.Fatal(err)
    }

    api, err := instana.NewInstanaAPIWithConfig(config)
    if err != nil {
        log.Fatal(err)
    }

    channel, err := api.AlertingChannels().GetOne("id")
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("Channel Name: %s\n", channel.Name)

Examples

See the examples directory for complete examples:

Support

Changelog

See CHANGELOG.md for version history and changes.


About

Repository that houses the go client code separated out from the terraform provider codebase

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors