44fd2a6871
* Boostrap Phoenix application from mix phx.new * Add opentelemetry dependencies * Setup opentelemetry for local env * Setup Dockerfile, docker-compose and otel config * Configure runtime config for exporter to export to otel collector in prod env * Generate Posts HTML resources * Add Release module to run migration in release * Generate Users LiveView resource * Add exporter configuration to export directly to external service * Update README.md to include description and instructions * Update README.md to include more details on exporting traces * Fix otlp collector deprecated ports as suggested
19 lines
309 B
Elixir
19 lines
309 B
Elixir
defmodule Demo.Blog.Post do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "posts" do
|
|
field :body, :string
|
|
field :title, :string
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(post, attrs) do
|
|
post
|
|
|> cast(attrs, [:title, :body])
|
|
|> validate_required([:title, :body])
|
|
end
|
|
end
|