diff --git a/apis/v1/jaeger_types.go b/apis/v1/jaeger_types.go index 3071bf5bf..81a4c7846 100644 --- a/apis/v1/jaeger_types.go +++ b/apis/v1/jaeger_types.go @@ -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"` @@ -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"` @@ -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. diff --git a/apis/v1/zz_generated.deepcopy.go b/apis/v1/zz_generated.deepcopy.go index 112b78b9c..ae18e394c 100644 --- a/apis/v1/zz_generated.deepcopy.go +++ b/apis/v1/zz_generated.deepcopy.go @@ -175,6 +175,7 @@ func (in *JaegerAllInOneSpec) DeepCopyInto(out *JaegerAllInOneSpec) { *out = *in in.Options.DeepCopyInto(&out.Options) in.Config.DeepCopyInto(&out.Config) + out.MetricsStorage = in.MetricsStorage in.JaegerCommonSpec.DeepCopyInto(&out.JaegerCommonSpec) if in.TracingEnabled != nil { in, out := &in.TracingEnabled, &out.TracingEnabled @@ -587,6 +588,21 @@ func (in *JaegerList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JaegerMetricsStorageSpec) DeepCopyInto(out *JaegerMetricsStorageSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JaegerMetricsStorageSpec. +func (in *JaegerMetricsStorageSpec) DeepCopy() *JaegerMetricsStorageSpec { + if in == nil { + return nil + } + out := new(JaegerMetricsStorageSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JaegerQuerySpec) DeepCopyInto(out *JaegerQuerySpec) { *out = *in @@ -596,6 +612,7 @@ func (in *JaegerQuerySpec) DeepCopyInto(out *JaegerQuerySpec) { **out = **in } in.Options.DeepCopyInto(&out.Options) + out.MetricsStorage = in.MetricsStorage in.JaegerCommonSpec.DeepCopyInto(&out.JaegerCommonSpec) if in.TracingEnabled != nil { in, out := &in.TracingEnabled, &out.TracingEnabled diff --git a/bundle/manifests/jaegertracing.io_jaegers.yaml b/bundle/manifests/jaegertracing.io_jaegers.yaml index b6500abc1..c778a30dc 100644 --- a/bundle/manifests/jaegertracing.io_jaegers.yaml +++ b/bundle/manifests/jaegertracing.io_jaegers.yaml @@ -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 @@ -6930,6 +6935,11 @@ spec: additionalProperties: type: string type: object + metricsStorage: + properties: + type: + type: string + type: object nodePort: format: int32 type: integer diff --git a/config/crd/bases/jaegertracing.io_jaegers.yaml b/config/crd/bases/jaegertracing.io_jaegers.yaml index 9fd564d83..78d864f65 100644 --- a/config/crd/bases/jaegertracing.io_jaegers.yaml +++ b/config/crd/bases/jaegertracing.io_jaegers.yaml @@ -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 @@ -6929,6 +6934,11 @@ spec: additionalProperties: type: string type: object + metricsStorage: + properties: + type: + type: string + type: object nodePort: format: int32 type: integer diff --git a/examples/all-in-one-with-metrics-query.yaml b/examples/all-in-one-with-metrics-query.yaml new file mode 100644 index 000000000..d39843949 --- /dev/null +++ b/examples/all-in-one-with-metrics-query.yaml @@ -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 \ No newline at end of file diff --git a/pkg/deployment/all_in_one.go b/pkg/deployment/all_in_one.go index 4f807adf3..5cbedb3ac 100644 --- a/pkg/deployment/all_in_one.go +++ b/pkg/deployment/all_in_one.go @@ -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", diff --git a/pkg/deployment/all_in_one_test.go b/pkg/deployment/all_in_one_test.go index f4c3de701..a4205814b 100644 --- a/pkg/deployment/all_in_one_test.go +++ b/pkg/deployment/all_in_one_test.go @@ -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", diff --git a/pkg/deployment/query.go b/pkg/deployment/query.go index fd119b445..8dd7d61b6 100644 --- a/pkg/deployment/query.go +++ b/pkg/deployment/query.go @@ -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),