From 5d9da4f437be16b28ef05fade350aeb33d73ab71 Mon Sep 17 00:00:00 2001 From: oleksandr-codefresh Date: Wed, 20 Nov 2024 17:54:03 +0200 Subject: [PATCH] event-reporter: added runtime version reporting with each event --- .../commands/event_reporter_server.go | 11 +- .../reporter/application_event_reporter.go | 5 +- event_reporter/reporter/event_payload.go | 24 ++- pkg/apiclient/events/events.pb.go | 203 +++++++++++------- pkg/codefresh/client.go | 9 +- server/application/events.proto | 2 + 6 files changed, 160 insertions(+), 94 deletions(-) diff --git a/cmd/event-reporter-server/commands/event_reporter_server.go b/cmd/event-reporter-server/commands/event_reporter_server.go index 5d39d70171d45..43b41695f3d44 100644 --- a/cmd/event-reporter-server/commands/event_reporter_server.go +++ b/cmd/event-reporter-server/commands/event_reporter_server.go @@ -96,6 +96,7 @@ func NewCommand() *cobra.Command { codefreshUrl string codefreshToken string shardingAlgorithm string + runtimeVersion string rootpath string useGrpc bool @@ -179,10 +180,11 @@ func NewCommand() *cobra.Command { ApplicationNamespaces: applicationNamespaces, ApplicationServiceClient: getApplicationClient(useGrpc, applicationServerAddress, argocdToken, rootpath), CodefreshConfig: &codefresh.CodefreshConfig{ - BaseURL: codefreshUrl, - AuthToken: codefreshToken, - TlsInsecure: codefreshTlsInsecure, - CaCertPath: codefreshTlsCertPath, + BaseURL: codefreshUrl, + AuthToken: codefreshToken, + TlsInsecure: codefreshTlsInsecure, + CaCertPath: codefreshTlsCertPath, + RuntimeVersion: runtimeVersion, }, RateLimiterOpts: &reporter.RateLimiterOpts{ Enabled: rateLimiterEnabled, @@ -236,6 +238,7 @@ func NewCommand() *cobra.Command { command.Flags().StringVar(&codefreshUrl, "codefresh-url", env.StringFromEnv("CODEFRESH_URL", "https://g.codefresh.io"), "Codefresh API url") command.Flags().StringVar(&codefreshToken, "codefresh-token", env.StringFromEnv("CODEFRESH_TOKEN", ""), "Codefresh token") command.Flags().StringVar(&shardingAlgorithm, "sharding-method", env.StringFromEnv(common.EnvEventReporterShardingAlgorithm, common.DefaultEventReporterShardingAlgorithm), "Enables choice of sharding method. Supported sharding methods are : [legacy] ") + command.Flags().StringVar(&runtimeVersion, "codefresh-runtime-version", env.StringFromEnv("CODEFRESH_RUNTIME_VERSION", ""), "Codefresh runtime version to be reported with each event to platform") command.Flags().StringSliceVar(&applicationNamespaces, "application-namespaces", env.StringsFromEnv("ARGOCD_APPLICATION_NAMESPACES", []string{}, ","), "List of additional namespaces where application resources can be managed in") command.Flags().BoolVar(&useGrpc, "grpc", env.ParseBoolFromEnv("USE_GRPC", false), "Use grpc for interact with argocd server") command.Flags().BoolVar(&rateLimiterEnabled, "rate-limiter-enabled", env.ParseBoolFromEnv("RATE_LIMITER_ENABLED", false), "Use rate limiter for prevent queue to be overflowed") diff --git a/event_reporter/reporter/application_event_reporter.go b/event_reporter/reporter/application_event_reporter.go index 8edfe3013aabf..359f694f7af5a 100644 --- a/event_reporter/reporter/application_event_reporter.go +++ b/event_reporter/reporter/application_event_reporter.go @@ -45,6 +45,7 @@ type applicationEventReporter struct { applicationServiceClient appclient.ApplicationClient metricsServer *metrics.MetricsServer db db.ArgoDB + runtimeVersion string } type ApplicationEventReporter interface { @@ -66,6 +67,7 @@ func NewApplicationEventReporter(cache *servercache.Cache, applicationServiceCli appLister: appLister, metricsServer: metricsServer, db: db, + runtimeVersion: codefreshConfig.RuntimeVersion, } } @@ -201,7 +203,7 @@ func (s *applicationEventReporter) StreamApplicationEvents( } else { // will get here only for root applications (not managed as a resource by another application) logCtx.Info("processing as root application") - appEvent, err := s.getApplicationEventPayload(ctx, a, appTree, eventProcessingStartedAt, applicationVersions, argoTrackingMetadata) + appEvent, err := s.getApplicationEventPayload(ctx, a, appTree, eventProcessingStartedAt, applicationVersions, argoTrackingMetadata, s.runtimeVersion) if err != nil { s.metricsServer.IncErroredEventsCounter(metrics.MetricParentAppEventType, metrics.MetricEventGetPayloadErrorType, a.Name) return fmt.Errorf("failed to get application event: %w", err) @@ -363,6 +365,7 @@ func (s *applicationEventReporter) processResource( desiredManifests: reportedEntityParentApp.desiredManifests, }, argoTrackingMetadata, + s.runtimeVersion, ) if err != nil { s.metricsServer.IncErroredEventsCounter(metricsEventType, metrics.MetricEventGetPayloadErrorType, reportedEntityParentApp.app.Name) diff --git a/event_reporter/reporter/event_payload.go b/event_reporter/reporter/event_payload.go index 57037f38f4c61..24d7cbd465011 100644 --- a/event_reporter/reporter/event_payload.go +++ b/event_reporter/reporter/event_payload.go @@ -24,6 +24,7 @@ func getResourceEventPayload( rr *ReportedResource, reportedEntityParentApp *ReportedEntityParentApp, argoTrackingMetadata *ArgoTrackingMetadata, + runtimeVersion string, ) (*events.Event, error) { var ( err error @@ -136,11 +137,12 @@ func getResourceEventPayload( } payload := events.EventPayload{ - Timestamp: appEventProcessingStartedAt, - Object: object, - Source: &source, - Errors: getResourceEventPayloadErrors(rr, reportedEntityParentApp), - AppVersions: applicationVersionsEvents, + Timestamp: appEventProcessingStartedAt, + Object: object, + Source: &source, + Errors: getResourceEventPayloadErrors(rr, reportedEntityParentApp), + AppVersions: applicationVersionsEvents, + RuntimeVersion: runtimeVersion, } if payload.AppVersions != nil { @@ -289,6 +291,7 @@ func (s *applicationEventReporter) getApplicationEventPayload( eventProcessingStartedAt string, applicationVersions *apiclient.ApplicationVersions, argoTrackingMetadata *ArgoTrackingMetadata, + runtimeVersion string, ) (*events.Event, error) { var ( syncStarted = metav1.Now() @@ -365,11 +368,12 @@ func (s *applicationEventReporter) getApplicationEventPayload( errors = append(errors, parseAggregativeHealthErrorsOfApplication(a, appTree)...) payload := events.EventPayload{ - Timestamp: eventProcessingStartedAt, - Object: object, - Source: source, - Errors: errors, - AppVersions: applicationVersionsEvents, + Timestamp: eventProcessingStartedAt, + Object: object, + Source: source, + Errors: errors, + AppVersions: applicationVersionsEvents, + RuntimeVersion: runtimeVersion, } logCtx.Infof("AppVersion before encoding: %v", utils.SafeString(payload.AppVersions.AppVersion)) diff --git a/pkg/apiclient/events/events.pb.go b/pkg/apiclient/events/events.pb.go index 9a9df5b3cd5fb..9abdc40a779b8 100644 --- a/pkg/apiclient/events/events.pb.go +++ b/pkg/apiclient/events/events.pb.go @@ -161,10 +161,12 @@ type EventPayload struct { // The errors of this object Errors []*ObjectError `protobuf:"bytes,4,rep,name=errors" json:"errors,omitempty"` // A version of the application and its dependencies - AppVersions *ApplicationVersions `protobuf:"bytes,5,opt,name=appVersions" json:"appVersions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + AppVersions *ApplicationVersions `protobuf:"bytes,5,opt,name=appVersions" json:"appVersions,omitempty"` + // A version of codefresh runtime + RuntimeVersion string `protobuf:"bytes,6,req,name=runtimeVersion" json:"runtimeVersion"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *EventPayload) Reset() { *m = EventPayload{} } @@ -235,6 +237,13 @@ func (m *EventPayload) GetAppVersions() *ApplicationVersions { return nil } +func (m *EventPayload) GetRuntimeVersion() string { + if m != nil { + return m.RuntimeVersion + } + return "" +} + // * // Holds information about the object source type ObjectSource struct { @@ -800,77 +809,78 @@ func init() { func init() { proto.RegisterFile("server/application/events.proto", fileDescriptor_3ad9267ec62b112f) } var fileDescriptor_3ad9267ec62b112f = []byte{ - // 1113 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x5d, 0x6f, 0x1c, 0x35, - 0x17, 0x7e, 0x67, 0xf3, 0xb9, 0x67, 0x37, 0x69, 0x5f, 0x37, 0x2d, 0x26, 0x84, 0x74, 0xb4, 0xaa, - 0xd0, 0xaa, 0x6a, 0x77, 0xd5, 0x00, 0x55, 0x5b, 0x21, 0xa4, 0x54, 0x2d, 0x10, 0x48, 0x00, 0x4d, - 0x68, 0x2f, 0x7a, 0xe7, 0xce, 0x9c, 0xce, 0xba, 0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0xb5, 0x22, 0x51, 0x83, 0x2e, 0x82, 0x53, 0x2e, 0x32, 0xff, - 0x8a, 0x36, 0x11, 0x74, 0x88, 0x93, 0xf8, 0xc7, 0x7d, 0x3d, 0x94, 0xf8, 0x27, 0x7e, 0x00, 0x5d, - 0xd1, 0xb4, 0x48, 0xf8, 0x58, 0x5c, 0xc0, 0x83, 0x17, 0xd0, 0x7f, 0x82, 0x0a, 0x45, 0x86, 0x22, - 0xe5, 0x68, 0xdc, 0x57, 0xa1, 0x90, 0xe9, 0xb4, 0x4a, 0xb3, 0x5f, 0x3b, 0x2c, 0x43, 0x65, 0xaa, - 0x34, 0xfb, 0xb5, 0x9b, 0x34, 0x1a, 0x7f, 0x9c, 0x73, 0x8d, 0x33, 0xf7, 0xdb, 0x2a, 0x13, 0x94, - 0xb4, 0xb0, 0x81, 0x82, 0x6b, 0x2b, 0x9e, 0x60, 0x72, 0x08, 0x70, 0xf1, 0x08, 0x57, 0x07, 0x05, - 0x08, 0x79, 0x08, 0xfd, 0x2c, 0xb8, 0x92, 0x3f, 0x36, 0xfc, 0x38, 0x84, 0xf7, 0x4d, 0x5a, 0xd4, - 0xc7, 0xc7, 0x6f, 0xde, 0x1e, 0x46, 0xbf, 0xbc, 0x3d, 0x8c, 0x7e, 0x7f, 0x7b, 0x18, 0xbd, 0xf8, - 0xf8, 0xdf, 0x7d, 0xf9, 0xd2, 0x82, 0xa3, 0xb0, 0xd5, 0xb7, 0xf1, 0xaf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xd1, 0x51, 0x14, 0xfd, 0x52, 0x0a, 0x00, 0x00, + // 1125 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xdd, 0x8e, 0x1b, 0xb5, + 0x17, 0xff, 0x27, 0xfb, 0x99, 0x93, 0xec, 0xb6, 0x7f, 0x77, 0x5b, 0xcc, 0xb2, 0x6c, 0xa3, 0x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0x7a, 0xbf, 0x01, 0x74, + 0xe2, 0x4b, 0x93, 0x01, 0x5c, 0xc9, 0xd0, 0x70, 0x8d, 0xd9, 0x05, 0x13, 0xfc, 0x15, 0x1a, 0x4b, + 0x1b, 0xdd, 0xc6, 0x42, 0x7f, 0x55, 0xe8, 0x8e, 0x63, 0xa9, 0x9d, 0xb2, 0x62, 0x41, 0x6f, 0x46, + 0xf4, 0x15, 0x19, 0xf9, 0x08, 0xda, 0x39, 0xb7, 0x0b, 0xea, 0x46, 0x44, 0x8d, 0x05, 0xe4, 0x18, + 0x76, 0x34, 0x2a, 0xf9, 0x2c, 0x39, 0xa7, 0x9b, 0x11, 0xa7, 0x02, 0x09, 0x85, 0x4d, 0xc5, 0xec, + 0xc8, 0x47, 0xa7, 0x12, 0x7a, 0x84, 0x74, 0x61, 0x57, 0xe3, 0x8c, 0x07, 0xc7, 0x97, 0xd2, 0x05, + 0x4a, 0x6e, 0xc3, 0x5e, 0x2a, 0x27, 0x13, 0x6e, 0x2f, 0xd0, 0x18, 0x96, 0x23, 0xdd, 0x89, 0x68, + 0x75, 0x11, 0xe9, 0x43, 0xa7, 0x04, 0x4e, 0xa7, 0x76, 0x24, 0x35, 0xdd, 0x8d, 0xa8, 0x35, 0x09, + 0xf9, 0x1a, 0xa0, 0xdc, 0x3f, 0x61, 0x16, 0x69, 0xcb, 0x67, 0xed, 0xf6, 0xa0, 0xec, 0xa8, 0x41, + 0xdc, 0x51, 0x03, 0x35, 0xce, 0x1d, 0x60, 0x06, 0xae, 0xa3, 0x06, 0xb3, 0x7b, 0x83, 0x1f, 0xf8, + 0x04, 0x93, 0x48, 0xdb, 0x79, 0xcf, 0x94, 0xfa, 0xd6, 0x55, 0x37, 0xc4, 0xde, 0x07, 0x90, 0x7c, + 0x05, 0x2d, 0xa6, 0xd4, 0x39, 0x7b, 0x89, 0x85, 0xa1, 0x6d, 0x5f, 0x53, 0xb7, 0xd6, 0x96, 0xa0, + 0xab, 0x96, 0x92, 0xf6, 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, + 0xc3, 0xf3, 0xf3, 0xe1, 0x62, 0xba, 0x78, 0x67, 0x2e, 0xeb, 0xa4, 0x64, 0x55, 0xab, 0xf7, 0x4b, + 0x03, 0x0e, 0xd6, 0x31, 0x9d, 0xaf, 0xb9, 0x96, 0x53, 0x55, 0x0b, 0x43, 0x09, 0x39, 0x5f, 0x67, + 0xe1, 0xc5, 0x8a, 0x23, 0x51, 0x81, 0x2e, 0x82, 0x63, 0x2e, 0x32, 0xff, 0xe6, 0x2e, 0x22, 0xe8, + 0x10, 0x27, 0xf1, 0x5f, 0x81, 0xcd, 0x58, 0xe2, 0x3f, 0x04, 0x3d, 0x68, 0x89, 0x45, 0x8b, 0xc4, + 0x8f, 0xc5, 0x12, 0xee, 0xbd, 0x80, 0xce, 0x13, 0x54, 0x28, 0x32, 0x14, 0x29, 0x47, 0xe3, 0x3e, + 0x16, 0x85, 0x4c, 0xc7, 0x21, 0xcd, 0x7e, 0xed, 0xb0, 0x0c, 0x95, 0x09, 0x69, 0xf6, 0x6b, 0x37, + 0x69, 0x34, 0xfe, 0x38, 0xe5, 0x1a, 0x27, 0xee, 0x6f, 0x56, 0x26, 0x28, 0xa9, 0x61, 0x3d, 0x05, + 0xd7, 0xd6, 0x3c, 0xd8, 0xe4, 0x18, 0x60, 0xf9, 0x64, 0x87, 0x83, 0x22, 0x84, 0x3c, 0x84, 0x4e, + 0x16, 0x5d, 0xc9, 0x1f, 0x1b, 0x7f, 0x33, 0xe2, 0xfb, 0x26, 0x35, 0xea, 0xe3, 0xd3, 0x37, 0x6f, + 0x8f, 0x1b, 0xbf, 0xbe, 0x3d, 0x6e, 0xfc, 0xf1, 0xf6, 0xb8, 0xf1, 0xe2, 0xe3, 0x7f, 0xf7, 0x41, + 0x4c, 0x0b, 0x8e, 0xc2, 0x86, 0x4f, 0xe6, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc5, 0xd7, 0x70, + 0xae, 0x80, 0x0a, 0x00, 0x00, } func (m *EventSource) Marshal() (dAtA []byte, err error) { @@ -985,6 +995,11 @@ func (m *EventPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + i -= len(m.RuntimeVersion) + copy(dAtA[i:], m.RuntimeVersion) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RuntimeVersion))) + i-- + dAtA[i] = 0x32 if m.AppVersions != nil { { size, err := m.AppVersions.MarshalToSizedBuffer(dAtA[:i]) @@ -1568,6 +1583,8 @@ func (m *EventPayload) Size() (n int) { l = m.AppVersions.Size() n += 1 + l + sovEvents(uint64(l)) } + l = len(m.RuntimeVersion) + n += 1 + l + sovEvents(uint64(l)) if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2214,6 +2231,39 @@ func (m *EventPayload) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuntimeVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + hasFields[0] |= uint64(0x00000008) default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -2239,6 +2289,9 @@ func (m *EventPayload) Unmarshal(dAtA []byte) error { if hasFields[0]&uint64(0x00000004) == 0 { return github_com_gogo_protobuf_proto.NewRequiredNotSetError("source") } + if hasFields[0]&uint64(0x00000008) == 0 { + return github_com_gogo_protobuf_proto.NewRequiredNotSetError("runtimeVersion") + } if iNdEx > l { return io.ErrUnexpectedEOF diff --git a/pkg/codefresh/client.go b/pkg/codefresh/client.go index d917fe9dd90e6..47158f6af6fd0 100644 --- a/pkg/codefresh/client.go +++ b/pkg/codefresh/client.go @@ -21,10 +21,11 @@ import ( ) type CodefreshConfig struct { - BaseURL string - AuthToken string - TlsInsecure bool - CaCertPath string + BaseURL string + AuthToken string + TlsInsecure bool + CaCertPath string + RuntimeVersion string } type CodefreshClient struct { diff --git a/server/application/events.proto b/server/application/events.proto index 4caf1dedfa7f8..045aa5888de7b 100644 --- a/server/application/events.proto +++ b/server/application/events.proto @@ -44,6 +44,8 @@ message EventPayload { repeated ObjectError errors = 4; // A version of the application and its dependencies optional ApplicationVersions appVersions = 5; + // A version of codefresh runtime + required string runtimeVersion = 6 [(gogoproto.nullable) = false]; } /**