Skip to content

Commit

Permalink
Moving delta-temporality as a metrics option
Browse files Browse the repository at this point in the history
  • Loading branch information
krzko committed Oct 2, 2022
1 parent 37fcd67 commit 9d20e83
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 9 deletions.
5 changes: 0 additions & 5 deletions internal/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,5 @@ func getGlobalFlags() []cli.Flag {
// EnvVars: []string{"OTEL_SERVICE_NAME"},
Value: "otelgen",
}),
altsrc.NewBoolFlag(&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
}),
}
}
7 changes: 7 additions & 0 deletions internal/cli/metrics_counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ var generateMetricsCounterCommand = &cli.Command{
Usage: "generate metrics of type counter",
Description: "Counter demonstrates how to measure non-decreasing numbers",
Aliases: []string{"c"},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Action: func(c *cli.Context) error {
return generateMetricsCounterAction(c)
},
Expand Down
9 changes: 8 additions & 1 deletion internal/cli/metrics_counter_observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ var generateMetricsCounterObserverCommand = &cli.Command{
Usage: "generate metrics of type counter, using observer",
Description: "CounterObserver demonstrates how to measure monotonic (non-decreasing) numbers",
Aliases: []string{"co"},
Hidden: true,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Hidden: true,
Action: func(c *cli.Context) error {
return generateMetricsCounterObserverAction(c)
},
Expand Down
7 changes: 7 additions & 0 deletions internal/cli/metrics_counter_observer_advanced.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ var generateMetricsCounterObserverAdvancedCommand = &cli.Command{
Usage: "generate metrics of type counter, using observer advanced pattern",
Description: "CounterObserverAdvanced demonstrates how to measure monotonic (non-decreasing) numbers",
Aliases: []string{"coa"},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Action: func(c *cli.Context) error {
return generateMetricsCounterObserverAdvancedAction(c)
},
Expand Down
9 changes: 8 additions & 1 deletion internal/cli/metrics_counter_with_labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ var generateMetricsCounterWithLabelsCommand = &cli.Command{
Usage: "generate metrics of type counter with labels",
Description: "CounterWithLabels demonstrates how to add different labels (\"hits\" and \"misses\")",
Aliases: []string{"cwl"},
Hidden: true,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Hidden: true,
Action: func(c *cli.Context) error {
return generateMetricsCounterWithLabelsAction(c)
},
Expand Down
9 changes: 8 additions & 1 deletion internal/cli/metrics_gauge_observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ var generateMetricsGaugeObserverCommand = &cli.Command{
Usage: "generate metrics of type gauge, using observer",
Description: "GaugeObserver demonstrates how to measure non-additive numbers that can go up and down",
Aliases: []string{"go"},
Hidden: true,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Hidden: true,
Action: func(c *cli.Context) error {
return generateMetricsGaugeObserverAction(c)
},
Expand Down
7 changes: 7 additions & 0 deletions internal/cli/metrics_histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ var generateMetricsHistogramCommand = &cli.Command{
Usage: "generate metrics of type histogram",
Description: "Histogram demonstrates how to record a distribution of individual values",
Aliases: []string{"h"},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Action: func(c *cli.Context) error {
return generateMetricsHistogramAction(c)
},
Expand Down
7 changes: 7 additions & 0 deletions internal/cli/metrics_up_down_counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ var generateMetricsUpDownCounterCommand = &cli.Command{
Usage: "generate metrics of type up down counter",
Description: "UpDownCounter demonstrates how to measure numbers that can go up and down",
Aliases: []string{"udc"},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Action: func(c *cli.Context) error {
return generateMetricsUpDownCounterAction(c)
},
Expand Down
9 changes: 8 additions & 1 deletion internal/cli/metrics_up_down_counter_observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ var generateMetricsUpDownCounterObserverCommand = &cli.Command{
Usage: "generate metrics of type up down counter, using observer",
Description: "UpDownCounterObserver demonstrates how to measure numbers that can go up and down",
Aliases: []string{"udco"},
Hidden: true,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "delta-temporality",
Usage: "Use delta temporality when exporting metrics (cumulative temporality is the default)",
Value: false,
},
},
Hidden: true,
Action: func(c *cli.Context) error {
return generateMetricsUpDownCounterObserverAction(c)
},
Expand Down

0 comments on commit 9d20e83

Please sign in to comment.