This directory contains practical examples demonstrating how to use the Instana Go Client library with the proper API methods.
File: usage_examples.go
Demonstrates 5 comprehensive examples of using the Instana Go Client:
- Basic Usage with User Agent - Using
NewInstanaAPIWithUserAgent()for simple client creation - Advanced Configuration - Using
NewInstanaAPIWithConfig()with comprehensive configuration options - Managing Alerting Channels - CRUD operations on alerting channels
- Application Configurations - Working with application configs and alerts
- API Tokens and Users - Managing API tokens, users, groups, roles, and teams
go get github.com/instana/instana-go-clientThe InstanaAPI interface provides access to all Instana resources:
- APITokens() - Manage API authentication tokens
- AlertingChannels() - Manage notification channels
- AlertingConfigurations() - Manage alert rules
- ApplicationAlertConfigs() - Application alert configurations
- ApplicationConfigs() - Application configurations
- AutomationActions() - Automation actions
- AutomationPolicies() - Automation policies
- CustomDashboards() - Custom dashboards
- CustomEventSpecifications() - Custom event specifications
- Groups() - RBAC groups
- InfraAlertConfigs() - Infrastructure alert configurations
- LogAlertConfigs() - Log alert configurations
- MaintenanceWindowConfigs() - Maintenance windows
- MobileAlertConfigs() - Mobile app alert configurations
- Roles() - RBAC roles
- SliConfigs() - SLI configurations
- SloAlertConfigs() - SLO alert configurations
- SloConfigs() - SLO configurations
- SyntheticAlertConfigs() - Synthetic alert configurations
- SyntheticTests() - Synthetic tests
- Teams() - RBAC teams
- Users() - Users (read-only)
- WebsiteAlertConfigs() - Website alert configurations
- WebsiteMonitoringConfigs() - Website monitoring configurations
- Use User Agent: Always set a meaningful user agent to track client usage
- Configure Timeouts: Set appropriate connection and request timeouts
- Enable Retry: Configure retry mechanism for better reliability
- Rate Limiting: Enable rate limiting to avoid hitting API limits
- Connection Pooling: Configure connection pooling for better performance