-
Notifications
You must be signed in to change notification settings - Fork 4.1k
store order to postgresql from accounting service #2175
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
Merged
puckpuck
merged 16 commits into
open-telemetry:main
from
cuichenli:add-postgresql-for-accounting
Jun 25, 2025
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b9297b3
store order to postgresql from accounting service
cuichenli 79c2951
Merge branch 'main' into add-postgresql-for-accounting
puckpuck ee32fcb
Merge branch 'main' of github.com:open-telemetry/opentelemetry-demo i…
cuichenli 5c96f11
Merge branch 'add-postgresql-for-accounting' of github.com:cuichenli/…
cuichenli e3ace52
update on comment
cuichenli e191c3e
fix trace not closed
cuichenli 248af07
Revert "fix trace not closed"
cuichenli 143cee6
disable entity framework instrumentation
cuichenli 58b8d31
clean
cuichenli 9e4b2b9
Merge branch 'main' into add-postgresql-for-accounting
cuichenli 8ab41de
Merge branch 'main' into add-postgresql-for-accounting
puckpuck 1ed1b8f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-demo i…
cuichenli a6b417c
group spans
cuichenli 9f72122
Merge branch 'add-postgresql-for-accounting' of github.com:cuichenli/…
cuichenli 3fd30bf
Merge branch 'main' into add-postgresql-for-accounting
puckpuck cd21189
fix for linter
puckpuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 @@ | ||
proto |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,59 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
using Microsoft.EntityFrameworkCore; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Accounting; | ||
|
||
[Table("shipping")] | ||
[PrimaryKey(nameof(ShippingTrackingId))] | ||
internal class ShippingEntity | ||
{ | ||
|
||
public required string ShippingTrackingId { get; set; } | ||
|
||
public required string ShippingCostCurrencyCode { get; set; } | ||
|
||
public required long ShippingCostUnits { get; set; } | ||
|
||
public required int ShippingCostNanos { get; set; } | ||
|
||
public required string StreetAddress { get; set; } | ||
|
||
public required string City { get; set; } | ||
|
||
public required string State { get; set; } | ||
|
||
public required string Country { get; set; } | ||
|
||
public required string ZipCode { get; set; } | ||
|
||
public required string OrderId { get; set; } | ||
} | ||
|
||
[Table("orderitem")] | ||
[PrimaryKey(nameof(ProductId), nameof(OrderId))] | ||
internal class OrderItemEntity | ||
{ | ||
public required string ItemCostCurrencyCode { get; set; } | ||
|
||
public required long ItemCostUnits { get; set; } | ||
|
||
public required int ItemCostNanos { get; set; } | ||
|
||
public required string ProductId { get; set; } | ||
|
||
public required int Quantity { get; set; } | ||
|
||
public required string OrderId { get; set; } | ||
} | ||
|
||
[Table("order")] | ||
[PrimaryKey(nameof(Id))] | ||
internal class OrderEntity | ||
{ | ||
[Column("order_id")] | ||
public required string Id { get; set; } | ||
|
||
} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,37 @@ | ||
-- Copyright The OpenTelemetry Authors | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
CREATE USER otelu WITH PASSWORD 'otelp'; | ||
|
||
|
||
-- Create a table | ||
CREATE TABLE "order" ( | ||
order_id TEXT PRIMARY KEY | ||
); | ||
|
||
CREATE TABLE shipping ( | ||
shipping_tracking_id TEXT PRIMARY KEY, | ||
shipping_cost_currency_code TEXT NOT NULL, | ||
shipping_cost_units BIGINT NOT NULL, | ||
shipping_cost_nanos INT NOT NULL, | ||
street_address TEXT, | ||
city TEXT, | ||
state TEXT, | ||
country TEXT, | ||
zip_code TEXT, | ||
order_id TEXT NOT NULL, | ||
FOREIGN KEY (order_id) REFERENCES "order"(order_id) ON DELETE CASCADE | ||
); | ||
|
||
CREATE TABLE orderitem ( | ||
item_cost_currency_code TEXT NOT NULL, | ||
item_cost_units BIGINT NOT NULL, | ||
item_cost_nanos INT NOT NULL, | ||
product_id TEXT NOT NULL, | ||
quantity INT NOT NULL, | ||
order_id TEXT NOT NULL, | ||
PRIMARY KEY (order_id, product_id), | ||
FOREIGN KEY (order_id) REFERENCES "order"(order_id) ON DELETE CASCADE | ||
); | ||
|
||
GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO otelu; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.