Skip to content

Commit

Permalink
Fix: #554 Add relevant texts to odigos cli help (#704)
Browse files Browse the repository at this point in the history
In this commit, I have made the following enhancements :

1. In "root.go," I updated the Short and Long descriptions to provide a
more meaningful and informative overview of the application's purpose
and capabilities.

2. In "observability.go," I improved the Short and Long descriptions for
the "observability" command. The descriptions now provide a clear
explanation of how to configure and manage observability for
applications and services, including the importance of observability,
available backends, and usage examples.****

#554 Fix #hacktoberfest

---------

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
  • Loading branch information
n16htb0t and blumamir authored Nov 2, 2023
1 parent 732f2f7 commit 217e708
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 34 deletions.
64 changes: 36 additions & 28 deletions cli/cmd/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ import (

// observabilityCmd represents the observability command
var observabilityCmd = &cobra.Command{
Use: "observability",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Use: "observability",
Short: "Configure and manage observability for your applications and services",
Long: `The observability command allows you to set up and manage observability and monitoring for your applications and services. It provides you with the tools to choose an observability backend, specify the signals you want to collect (e.g., traces, metrics, logs), and define the settings for your observability infrastructure.
Observability is crucial for understanding how your applications are performing, diagnosing issues, and ensuring the reliability of your services. It enables you to gain valuable insights into the behavior of your systems.
You can select from a variety of observability backends, such as Grafana Cloud, Logz.io, and more. Each backend offers unique features and integrations. You can pick the one that aligns best with your specific needs.
Usage Examples:
- Configure observability with Grafana Cloud:
odigos observability --backend grafana-cloud --signal traces,metrics,logs --api-key <YOUR_API_KEY>
- Configure observability with Logz.io:
odigos observability --backend logzio --signal traces,metrics,logs --tracing-token <YOUR_TRACING_TOKEN> --metrics-token <YOUR_METRICS_TOKEN> --logs-token <YOUR_LOGS_TOKEN>
You have the flexibility to customize your observability setup according to your precise requirements. Utilize the provided flags to specify the backend, select the signals to capture, and set other options. Make informed decisions to effectively monitor, analyze, and enhance the performance of your applications and services.`,
RunE: func(cmd *cobra.Command, args []string) error {
if err := isValidBackend(backendFlag); err != nil {
return err
Expand Down Expand Up @@ -183,23 +191,23 @@ func getOdigosNamespace(kubeClient *kube.Client, ctx context.Context) (string, e
}

func init() {
observabilityCmd.Flags().StringVar(&backendFlag, "backend", "", "Backend for observability data")
observabilityCmd.Flags().StringSliceVarP(&signalsFlag, "signal", "s", nil, "Reported signals [traces,metrics,logs]")
observabilityCmd.Flags().BoolVarP(&skipConfirm, "no-prompt", "y", false, "Skip install confirmation")
observabilityCmd.Flags().StringVarP(&urlFlag, "url", "u", "", "URL of the backend for observability data")
observabilityCmd.Flags().StringVar(&apiKeyFlag, "api-key", "", "API key for the selected backend")
observabilityCmd.Flags().StringVar(&regionFlag, "region", "", "Region for the selected backend")

// Grafana Cloud Flags
observabilityCmd.Flags().StringVar(&grafanaTempoUrl, backend.GrafanaTempoUrlFlag, "", "URL for Grafana Cloud Tempo instance")
observabilityCmd.Flags().StringVar(&grafanaTempoUser, backend.GrafanaTempoUserFlag, "", "User for Grafana Cloud Tempo instance")
observabilityCmd.Flags().StringVar(&grafanaRemoteWriteUrl, backend.GrafanaPromUrlFlag, "", "RemoteWrite URL for Grafana Cloud prometheus instance")
observabilityCmd.Flags().StringVar(&grafanaPromUser, backend.GrafanaPromUserFlag, "", "User for Grafana Cloud prometheus instance")
observabilityCmd.Flags().StringVar(&grafanaLokiUrl, backend.GrafanaLokiUrlFlag, "", "URL for Grafana Cloud Loki instance")
observabilityCmd.Flags().StringVar(&grafanaLokiUser, backend.GrafanaLokiUserFlag, "", "User for Grafana Cloud Loki instance")

// Logz.io Flags
observabilityCmd.Flags().StringVar(&logzioTracingToken, backend.LogzioTracingToken, "", "Tracing token for Logz.io")
observabilityCmd.Flags().StringVar(&logzioMetricsToken, backend.LogzioMetricsToken, "", "Metrics token for Logz.io")
observabilityCmd.Flags().StringVar(&logzioLoggingToken, backend.LogzioLogsToken, "", "Logging token for Logz.io")
}
observabilityCmd.Flags().StringVar(&backendFlag, "backend", "", "Specify the observability backend (e.g., Grafana, Logz.io)")
observabilityCmd.Flags().StringSliceVarP(&signalsFlag, "signal", "s", nil, "Specify reported signals (e.g., traces, metrics, logs)")
observabilityCmd.Flags().BoolVarP(&skipConfirm, "no-prompt", "y", false, "Skip installation confirmation")
observabilityCmd.Flags().StringVarP(&urlFlag, "url", "u", "", "Set the URL of the observability backend")
observabilityCmd.Flags().StringVar(&apiKeyFlag, "api-key", "", "Provide the API key for the selected backend")
observabilityCmd.Flags().StringVar(&regionFlag, "region", "", "Specify the region for the selected backend")

// Grafana Cloud Flags
observabilityCmd.Flags().StringVar(&grafanaTempoUrl, backend.GrafanaTempoUrlFlag, "", "Set the URL for Grafana Cloud Tempo instance")
observabilityCmd.Flags().StringVar(&grafanaTempoUser, backend.GrafanaTempoUserFlag, "", "Specify the user for Grafana Cloud Tempo instance")
observabilityCmd.Flags().StringVar(&grafanaRemoteWriteUrl, backend.GrafanaPromUrlFlag, "", "Set the RemoteWrite URL for Grafana Cloud Prometheus instance")
observabilityCmd.Flags().StringVar(&grafanaPromUser, backend.GrafanaPromUserFlag, "", "Specify the user for Grafana Cloud Prometheus instance")
observabilityCmd.Flags().StringVar(&grafanaLokiUrl, backend.GrafanaLokiUrlFlag, "", "Set the URL for Grafana Cloud Loki instance")
observabilityCmd.Flags().StringVar(&grafanaLokiUser, backend.GrafanaLokiUserFlag, "", "Specify the user for Grafana Cloud Loki instance")

// Logz.io Flags
observabilityCmd.Flags().StringVar(&logzioTracingToken, backend.LogzioTracingToken, "", "Set the tracing token for Logz.io")
observabilityCmd.Flags().StringVar(&logzioMetricsToken, backend.LogzioMetricsToken, "", "Set the metrics token for Logz.io")
observabilityCmd.Flags().StringVar(&logzioLoggingToken, backend.LogzioLogsToken, "", "Set the logging token for Logz.io")
}
15 changes: 9 additions & 6 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ import (
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "odigos",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Short: "Automate OpenTelemetry Observability in Kubernetes",
Long: `Odigos is primarily focused on automating OpenTelemetry observability pipelines for traces, metrics, and logs, without the need for extensive code changes. The core of Odigos functionality lies in the Kubernetes operators it deploys within your cluster, enabling seamless observability.
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Key Features of Odigos:
- Automatic creation of OpenTelemetry observability pipelines.
- Simplified tracing, metrics, and log collection.
- Enhanced visibility into your Kubernetes services.
- Streamlined Kubernetes operations with observability at the forefront.
Get started with Odigos today to effortlessly improve the observability of your Kubernetes services!`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Expand Down

0 comments on commit 217e708

Please sign in to comment.