Skip to content

Commit

Permalink
add METRICS_STORAGE_TYPE for metrics query (jaegertracing#1755)
Browse files Browse the repository at this point in the history
* finish

Signed-off-by: jian.tan <[email protected]>

* revert CHANGELOG.md

Signed-off-by: jian.tan <[email protected]>

* fix bundle.

Signed-off-by: jian.tan <[email protected]>

* fix jaeger image.

Signed-off-by: jian.tan <[email protected]>
  • Loading branch information
JaredTan95 authored Mar 4, 2022
1 parent d20717a commit 7762494
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apis/v1/jaeger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ type JaegerQuerySpec struct {
// +kubebuilder:pruning:PreserveUnknownFields
Options Options `json:"options,omitempty"`

// +optional
MetricsStorage JaegerMetricsStorageSpec `json:"metricsStorage,omitempty"`

// +optional
JaegerCommonSpec `json:",inline,omitempty"`

Expand Down Expand Up @@ -351,6 +354,9 @@ type JaegerAllInOneSpec struct {
// +kubebuilder:pruning:PreserveUnknownFields
Config FreeForm `json:"config,omitempty"`

// +optional
MetricsStorage JaegerMetricsStorageSpec `json:"metricsStorage,omitempty"`

// +optional
JaegerCommonSpec `json:",inline,omitempty"`

Expand Down Expand Up @@ -509,6 +515,12 @@ type JaegerStorageSpec struct {
GRPCPlugin GRPCPluginSpec `json:"grpcPlugin,omitempty"`
}

// JaegerMetricsStorageSpec defines the Metrics storage options to be used for the query and collector.
type JaegerMetricsStorageSpec struct {
// +optional
Type JaegerStorageType `json:"type,omitempty"`
}

// ElasticsearchSpec represents the ES configuration options that we pass down to the OpenShift Elasticsearch operator.
type ElasticsearchSpec struct {
// Name of the OpenShift Elasticsearch instance. Defaults to elasticsearch.
Expand Down
17 changes: 17 additions & 0 deletions apis/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions bundle/manifests/jaegertracing.io_jaegers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2039,6 +2039,11 @@ spec:
additionalProperties:
type: string
type: object
metricsStorage:
properties:
type:
type: string
type: object
options:
type: object
x-kubernetes-preserve-unknown-fields: true
Expand Down Expand Up @@ -6930,6 +6935,11 @@ spec:
additionalProperties:
type: string
type: object
metricsStorage:
properties:
type:
type: string
type: object
nodePort:
format: int32
type: integer
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/jaegertracing.io_jaegers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,11 @@ spec:
additionalProperties:
type: string
type: object
metricsStorage:
properties:
type:
type: string
type: object
options:
type: object
x-kubernetes-preserve-unknown-fields: true
Expand Down Expand Up @@ -6929,6 +6934,11 @@ spec:
additionalProperties:
type: string
type: object
metricsStorage:
properties:
type:
type: string
type: object
nodePort:
format: int32
type: integer
Expand Down
20 changes: 20 additions & 0 deletions examples/all-in-one-with-metrics-query.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: jaegertracing.io/v1
kind: "Jaeger"
metadata:
name: "my-jaeger"
spec:
strategy: allInOne
allInOne:
image: jaegertracing/all-in-one:1.31
options:
log-level: debug
query:
base-path: /jaeger
prometheus:
server-url: "http://prometheus:9090"
metricsStorage:
type: prometheus
storage:
options:
memory:
max-traces: 100000
4 changes: 4 additions & 0 deletions pkg/deployment/all_in_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ func (a *AllInOne) Get() *appsv1.Deployment {
Name: "SPAN_STORAGE_TYPE",
Value: string(a.jaeger.Spec.Storage.Type),
},
{
Name: "METRICS_STORAGE_TYPE",
Value: string(a.jaeger.Spec.AllInOne.MetricsStorage.Type),
},
{
Name: "COLLECTOR_ZIPKIN_HOST_PORT",
Value: ":9411",
Expand Down
4 changes: 4 additions & 0 deletions pkg/deployment/all_in_one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func TestDefaultAllInOneImage(t *testing.T) {
Name: "SPAN_STORAGE_TYPE",
Value: "",
},
{
Name: "METRICS_STORAGE_TYPE",
Value: "",
},
{
Name: "COLLECTOR_ZIPKIN_HOST_PORT",
Value: ":9411",
Expand Down
4 changes: 4 additions & 0 deletions pkg/deployment/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ func (q *Query) Get() *appsv1.Deployment {
Name: "SPAN_STORAGE_TYPE",
Value: string(q.jaeger.Spec.Storage.Type),
},
{
Name: "METRICS_STORAGE_TYPE",
Value: string(q.jaeger.Spec.Query.MetricsStorage.Type),
},
{
Name: "JAEGER_DISABLED",
Value: strconv.FormatBool(jaegerDisabled),
Expand Down

0 comments on commit 7762494

Please sign in to comment.