-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hackathon (Core) - Telemetry and analytics #31318
base: main
Are you sure you want to change the base?
Hackathon (Core) - Telemetry and analytics #31318
Conversation
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
public class ContentAnalyticsUtil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc me and probably helper will be a more accurate name
|
||
|
||
//Logging analytics for FTM if the publishing date is older than five minutes now | ||
if (timeMachineDateInstant.isPresent() && isOlderThanFiveMinutes(timeMachineDateInstant.get())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks such as the same code, so may want to encapsulate in a method
@@ -223,6 +226,10 @@ private MetricStatsCollector() { | |||
metricStatsCollectors.add(new CountOfTimeFieldsMetricType()); | |||
metricStatsCollectors.add(new CountOfWYSIWYGFieldsMetricType()); | |||
|
|||
metricStatsCollectors.add(new TotalSitesUsingDotaiMetricType()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to DotAI
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
public class TotalEmbeddingsIndexesMetricType implements MetricType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
public class TotalSitesUsingDotaiMetricType implements MetricType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc me
return Optional.of(new MetricValue(this.getMetric(), sitesWithConfigurations.size())); | ||
} catch (final DotSecurityException e) { | ||
throw new DotDataException(e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finally here to destroy the secrets
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
public class TotalSitesWithAutoIndexContentConfigMetricType implements MetricType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docme
return Optional.of(new MetricValue(this.getMetric(), counter)); | ||
} catch (final DotSecurityException e) { | ||
throw new DotDataException(e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
finally delete secrets
Focusing on adding new event types and sources, and enhancing the CLI tool with analytics tracking capabilities. The most important changes include adding new event sources and types, creating a new analytics API, and modifying the CLI tool to support event recording.
Event Source and Type Additions:
dotCMS/src/main/java/com/dotcms/analytics/track/collectors/EventSource.java
: AddedDOT_CLI
as a new event source.dotCMS/src/main/java/com/dotcms/analytics/track/collectors/EventType.java
: AddedCMD_EXECUTED
as a new event type.Analytics API Implementation:
tools/dotcms-cli/api-data-model/src/main/java/com/dotcms/api/AnalyticsAPI.java
: Created a newAnalyticsAPI
interface to handle custom user events.tools/dotcms-cli/api-data-model/src/main/java/com/dotcms/model/analytics/AbstractDotCliEvent.java
: Defined a newAbstractDotCliEvent
interface for CLI event data.CLI Tool Enhancements:
tools/dotcms-cli/cli/src/main/java/com/dotcms/cli/command/CustomConfigurationUtil.java
: InjectedRestClientFactory
to support the new analytics API. [1] [2] [3] [4]tools/dotcms-cli/cli/src/main/java/com/dotcms/cli/common/DotExecutionStrategy.java
: Modified the execution strategy to record events asynchronously using the new analytics API. [1] [2] [3] [4] [5]Additional changes: