Skip to content

Commit

Permalink
Merge pull request #1670 from OneUptime/master
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
simlarsen committed Sep 5, 2024
2 parents 6e10739 + fb1f129 commit 806fada
Show file tree
Hide file tree
Showing 82 changed files with 2,981 additions and 1,016 deletions.
2 changes: 1 addition & 1 deletion App/FeatureSet/ApiReference/views/partials/nav.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
href="/">Home</a></li>
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
target="_blank"
href="https://oneuptimesupport.slack.com/join/shared_invite/zt-1kavkds2f-gegm_wePorvwvM3M_SaoCQ#/shared-invite/email">Chat
href="https://join.slack.com/t/oneuptimesupport/shared_invite/zt-2pz5p1uhe-Fpmc7bv5ZE5xRMe7qJnwmA">Chat
with us on Slack</a></li>
<li><a class="text-sm leading-5 text-zinc-600 transition hover:text-zinc-900 "
href="/support">Support</a></li>
Expand Down
15 changes: 15 additions & 0 deletions App/FeatureSet/BaseAPI/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ import LogService, {
import TelemetryAttributeService, {
TelemetryAttributeService as TelemetryAttributeServiceType,
} from "Common/Server/Services/TelemetryAttributeService";
import CopilotActionTypePriorityService, {
Service as CopilotActionTypePriorityServiceType,
} from "Common/Server/Services/CopilotActionTypePriorityService";

import MetricService, {
MetricService as MetricServiceType,
Expand Down Expand Up @@ -425,6 +428,7 @@ import ServiceCatalogDependency from "Common/Models/DatabaseModels/ServiceCatalo
import TelemetryAttribute from "Common/Models/AnalyticsModels/TelemetryAttribute";
import ExceptionInstance from "Common/Models/AnalyticsModels/ExceptionInstance";
import TelemetyException from "Common/Models/DatabaseModels/TelemetryException";
import CopilotActionTypePriority from "Common/Models/DatabaseModels/CopilotActionTypePriority";

const BaseAPIFeatureSet: FeatureSet = {
init: async (): Promise<void> => {
Expand Down Expand Up @@ -461,6 +465,17 @@ const BaseAPIFeatureSet: FeatureSet = {
new BaseAnalyticsAPI<Log, LogServiceType>(Log, LogService).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAPI<
CopilotActionTypePriority,
CopilotActionTypePriorityServiceType
>(
CopilotActionTypePriority,
CopilotActionTypePriorityService,
).getRouter(),
);

app.use(
`/${APP_NAME.toLocaleLowerCase()}`,
new BaseAnalyticsAPI<Metric, MetricServiceType>(
Expand Down
45 changes: 44 additions & 1 deletion App/FeatureSet/Docs/Content/telemetry/open-telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Once you created a token, click on "View" to view the token.
![View Service](/docs/static/images/TelemetryIngestionKeyView.png)


### Step 2 - Configure the telemetry service in your application.
### Step 2

#### Configure the telemetry service in your application.

#### Application Logs

Expand Down Expand Up @@ -56,3 +58,44 @@ export OTEL_SERVICE_NAME=my-service
If you're self-hosting oneuptime, this can be changed to your self hosted OpenTelemetry collector endpoint (eg: `http(s)://<your-oneuptime-host>/otlp`)

Once you run your application, you should see the logs in the OneUptime telemetry service page. Please contact support@oneuptime.com if you need any help.


#### Using OpenTelemetry Collector

You can also use the OpenTelemetry collector instead of sending telemetry data directly from your application.
If you are using OpenTelemetry Collector, you can configure the OneUptime exporter in the collector configuration file.

Here is the example configuration for OpenTelemetry Collector.

```yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318

exporters:

# Export over HTTP
otlphttp:
endpoint: "https://oneuptime.com/otlp"
# Requires use JSON encoder insted of default Proto(buf)
encoding: json
headers:
"Content-Type": "application/json"
"x-oneuptime-token": "ONEUPTIME_TOKEN" # Your OneUptime token

service:
pipelines:
traces:
receivers: [otlp]
exporters: [otlphttp]
metrics:
receivers: [otlp]
exporters: [otlphttp]
logs:
receivers: [otlp]
exporters: [otlphttp]
```
2 changes: 1 addition & 1 deletion App/FeatureSet/Home/Views/Partials/copilot.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<span><strong class="font-semibold text-gray-900">
Automatically add telemetry code.
</strong>
No need to manually add it. Add tracing, metrics, and logs to your codebase with a single
No need to manually add it. Add tracing, metrics, and logs in your codebase with a single
click.
</span>
</li>
Expand Down
2 changes: 1 addition & 1 deletion App/FeatureSet/Home/Views/support.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<p class="mt-4 text-base text-gray-500">We are here to help with any questions related to Dashboard, API, Product Features, etc. Chat with us on Slack. Enterprise customers have a dedicated Slack channel with us.</p>
</div>
<div class="rounded-bl-2xl rounded-br-2xl bg-gray-50 p-6 md:px-8">
<a href="https://oneuptimesupport.slack.com/join/shared_invite/zt-1kavkds2f-gegm_wePorvwvM3M_SaoCQ" target="_blank" class="text-base font-medium text-indigo-700 hover:text-indigo-600">Chat on Slack<span aria-hidden="true"> &rarr;</span></a>
<a href="https://join.slack.com/t/oneuptimesupport/shared_invite/zt-2pz5p1uhe-Fpmc7bv5ZE5xRMe7qJnwmA" target="_blank" class="text-base font-medium text-indigo-700 hover:text-indigo-600">Chat on Slack<span aria-hidden="true"> &rarr;</span></a>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import DataMigrationBase from "./DataMigrationBase";
import LIMIT_MAX from "Common/Types/Database/LimitMax";
import CopilotCodeRepository from "Common/Models/DatabaseModels/CopilotCodeRepository";
import CopilotCodeRepositoryService from "Common/Server/Services/CopilotCodeRepositoryService";
import {
CopilotActionTypeData,
CopilotActionTypeUtil,
} from "Common/Types/Copilot/CopilotActionType";
import CopilotActionTypePriority from "Common/Models/DatabaseModels/CopilotActionTypePriority";
import CopilotActionTypePriorityService from "Common/Server/Services/CopilotActionTypePriorityService";

export default class AddDefaultCopilotActionTypes extends DataMigrationBase {
public constructor() {
super("AddDefaultCopilotActionTypes");
}

public override async migrate(): Promise<void> {
// get all the users with email isVerified true.

const repositories: Array<CopilotCodeRepository> =
await CopilotCodeRepositoryService.findBy({
query: {},
select: {
_id: true,
projectId: true,
},
skip: 0,
limit: LIMIT_MAX,
props: {
isRoot: true,
},
});

for (const repo of repositories) {
const defaultCopilotActionTypes: Array<CopilotActionTypeData> =
CopilotActionTypeUtil.getAllCopilotActionTypes();

for (const defaultAction of defaultCopilotActionTypes) {
const copilotActionTypePriority: CopilotActionTypePriority =
new CopilotActionTypePriority();
copilotActionTypePriority.projectId = repo.projectId!;
copilotActionTypePriority.actionType = defaultAction.type;
copilotActionTypePriority.priority = defaultAction.defaultPriority;
copilotActionTypePriority.codeRepositoryId = repo.id!;

await CopilotActionTypePriorityService.create({
data: copilotActionTypePriority,
props: {
isRoot: true,
},
});
}
}
}

public override async rollback(): Promise<void> {
return;
}
}
2 changes: 2 additions & 0 deletions App/FeatureSet/Workers/DataMigrations/Index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import UpdateGlobalConfigFromEnv from "./UpdateGlobalCongfigFromEnv";
import MigrateServiceLanguageToTechStack from "./MigrateServiceLanguageToTechStack";
import DeleteOldTelemetryTable from "./DeleteOldTelelmetryTable";
import MoveTelemetryServiceTokenToTelemetryIngestionKey from "./MoveTelemetryServiceTokenToTelemetryIngestionKey";
import AddDefaultCopilotActionTypes from "./AddDefaultCopilotActionTypes";

// This is the order in which the migrations will be run. Add new migrations to the end of the array.

Expand Down Expand Up @@ -73,6 +74,7 @@ const DataMigrations: Array<DataMigrationBase> = [
new MigrateServiceLanguageToTechStack(),
new DeleteOldTelemetryTable(),
new MoveTelemetryServiceTokenToTelemetryIngestionKey(),
new AddDefaultCopilotActionTypes(),
];

export default DataMigrations;
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RunCron(
},
async () => {
return await Telemetry.startActiveSpan<Promise<void>>({
name: "StatusPageCerts:OrderSSL",
name: "StatusPageCerts.OrderSSL",
options: {
attributes: {
schedule: IsDevelopment ? EVERY_FIFTEEN_MINUTE : EVERY_FIFTEEN_MINUTE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This trigger lets you start the workflow with the incoming HTTP request.
**URL of this trigger:**


```
```yaml
{{serverUrl}}workflow/trigger/{{workflowId}}
```

Expand Down
Loading

0 comments on commit 806fada

Please sign in to comment.