forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59e0528
commit f9c2982
Showing
25 changed files
with
427 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: System | ||
metadata: | ||
name: opentelemetry-demo | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/ | ||
description: OTEL demo app | ||
spec: | ||
owner: user:guest | ||
--- | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Group | ||
metadata: | ||
name: devs | ||
spec: | ||
type: team | ||
children: [] | ||
--- | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: User | ||
metadata: | ||
name: guest | ||
spec: | ||
memberOf: [devs] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import os | ||
|
||
# Template string for backstage.yaml | ||
template = """ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: {service_name} | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/{service_name}/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
""" | ||
|
||
def create_backstage_file(directory): | ||
# Construct the file path for backstage.yaml | ||
backstage_file_path = os.path.join(directory, "backstage.yaml") | ||
|
||
# Extract the directory name from the full path | ||
directory_name = os.path.basename(directory) | ||
|
||
# Fill in the template with the directory name | ||
backstage_content = template.format(service_name=directory_name) | ||
|
||
# Write the content to the backstage.yaml file | ||
with open(backstage_file_path, 'w') as f: | ||
f.write(backstage_content) | ||
|
||
print(f"Created backstage.yaml in {directory}") | ||
|
||
def scan_directories(root_directory): | ||
from pathlib import Path | ||
dirs = sorted([d for d in Path(root_directory).iterdir() if d.is_dir()]) | ||
for entry in dirs: | ||
#create_backstage_file(entry) | ||
print(f' - ./{entry}/backstage.yaml') | ||
|
||
if __name__ == "__main__": | ||
root_directory = "./src" | ||
|
||
if not os.path.exists(root_directory): | ||
print("Root directory not found.") | ||
else: | ||
scan_directories(root_directory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: Location | ||
metadata: | ||
name: opentelemetry-demo | ||
description: A collection of all Backstage example entities, except users, groups, and templates | ||
annotations: | ||
github.com/project-slug: jmichalak9/opentelemetry-demo | ||
spec: | ||
targets: | ||
- ./pb/backstage.yaml | ||
- ./src/accountingservice/backstage.yaml | ||
- ./src/adservice/backstage.yaml | ||
- ./src/cartservice/backstage.yaml | ||
- ./src/checkoutservice/backstage.yaml | ||
- ./src/currencyservice/backstage.yaml | ||
- ./src/emailservice/backstage.yaml | ||
- ./src/featureflagservice/backstage.yaml | ||
- ./src/ffspostgres/backstage.yaml | ||
- ./src/frauddetectionservice/backstage.yaml | ||
- ./src/frontend/backstage.yaml | ||
- ./src/frontendproxy/backstage.yaml | ||
- ./src/grafana/backstage.yaml | ||
- ./src/kafka/backstage.yaml | ||
- ./src/loadgenerator/backstage.yaml | ||
- ./src/otelcollector/backstage.yaml | ||
- ./src/paymentservice/backstage.yaml | ||
- ./src/productcatalogservice/backstage.yaml | ||
- ./src/prometheus/backstage.yaml | ||
- ./src/quoteservice/backstage.yaml | ||
- ./src/recommendationservice/backstage.yaml | ||
- ./src/shippingservice/backstage.yaml | ||
- https://github.com/jmichalak9/opentelemetry.io/blob/main/catalog-info.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: backstage.io/v1alpha1 | ||
kind: API | ||
metadata: | ||
name: pb | ||
description: grpc api | ||
spec: | ||
type: grpc | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
definition: | ||
$text: ./demo.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: accountingservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/accountingservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- resource:default/kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: adservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/adservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- component:default/featureflagservice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: cartservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/cartservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- component:default/featureflagservice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: checkoutservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/checkoutservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- component:default/cartservice | ||
- component:default/currencyservice | ||
- component:default/emailservice | ||
- component:default/paymentservice | ||
- component:default/productcatalogservice | ||
- component:default/shippingservice | ||
- resource:default/kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: currencyservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/currencyservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: emailservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/emailservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: featureflagservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/featureflagservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- resource:default/ffspostgres | ||
providesApis: [pb] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Resource | ||
metadata: | ||
name: ffspostgres | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/ffspostgres/ | ||
spec: | ||
type: database | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: frauddetectionservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/frauddetectionservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- resource:default/kafka |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: frontend | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/frontend/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- component:default/cartservice | ||
- component:default/currencyservice | ||
- component:default/checkoutservice | ||
- component:default/productcatalogservice | ||
- component:default/shippingservice | ||
- component:default/recommendationservice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: frontendproxy | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/frontendproxy/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- component:default/frontend | ||
- component:default/featureflagservice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: grafana | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/grafana/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Resource | ||
metadata: | ||
name: kafka | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/kafka/ | ||
spec: | ||
type: database | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: loadgenerator | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/loadgenerator/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- component:default/frontendproxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: otelcollector | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/otelcollector/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: paymentservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/paymentservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
apiVersion: backstage.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: productcatalogservice | ||
description: This service is responsible to process a checkout order from the user. The checkout service will call many other services in order to process an order. | ||
annotations: | ||
backstage.io/techdocs-ref: url:https://opentelemetry.io/docs/demo/services/productcatalogservice/ | ||
spec: | ||
type: service | ||
lifecycle: production | ||
owner: user:guest | ||
system: opentelemetry-demo | ||
dependsOn: | ||
- component:default/featureflagservice |
Oops, something went wrong.