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.
go get github.com/instana/instana-go-client // 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) 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)See the examples directory for complete examples:
- Issues: GitHub Issues
See CHANGELOG.md for version history and changes.