Skip to content

Instantly share code, notes, and snippets.


Nathan L Smith smith

View GitHub Profile
smith /
Created Jun 30, 2022
Running the OpenTelemetry Community Demo with Elastic
  • Clone
  • On an Elastic Cloud instance, add a new agent on your local machine
  • Enable the APM integration. curl http://localhost:8200 should respond with JSON indicating the APM server is running
  • Follow the instructions for modifying otelcol-config.yml, but make it:
    endpoint: host.docker.internal:8200
 insecure: true
smith / Remix & Elastic APM distributed tracing
Created Dec 13, 2021
Remix & Elastic APM distributed tracing correlation
View Remix & Elastic APM distributed tracing

We want to instrument Remix apps with the Elastic APM Node.js Agent on the server and the Elastic APM Real User Monitoring JavaScript Agent on the client.

We want the server-rendered page to have the trace id and other data available to the client, so we can correlate the traces between server and client. Elastic's distributed tracing docs explain this.

I've been able to make this work with Remix on Express, but it's super hacky, so this gist shows what I'm doing so hopefully somebody can point me to a better way to do this.

smith / Remix & Elastic APM Client-Side
Last active Dec 13, 2021
Remix & Elastic APM Client-Side setup
View Remix & Elastic APM Client-Side

Keybase proof

I hereby claim:

  • I am smith on github.
  • I am nlsmith ( on keybase.
  • I have a public key whose fingerprint is 1D7D E99D 424F 651D 7C30 D888 ADE3 ABB3 5452 1F41

To claim this, I am signing this object:

View installed extensions
# List of installed extensions. These are not the friendly names on the marketplace, but you could figure it out,
# and I think you can run `code --install-extension Orta.vsocde-jest`
nsmith@nsmith ~/s/s/m/meatballs-ui> code --list-extensions (master=)
smith / AComponent.js
Last active Aug 31, 2017
Caching HOC?
View AComponent.js
import React, { Component } from 'react'
import cacheComponent from './cacheComponent'
class AComponent extends Component {
onClick = () => {
this.props.set({ clicked: true });
render() {
return <div>Have I been clicked? {this.props.cache.clicked ? "yes :)" : "no :("} <button onClick={this.onClick}>click me</button></div>;
View gist:293e61c1bf0d6403fc7b0f4c46566dbd
gcc: WARN
gcc: WARN The following runtime dependencies have more than one version
gcc: WARN release in the full dependency chain:
gcc: WARN
gcc: WARN * core/gmp ( core/gmp/6.1.2/20170526062114 core/gmp/6.1.0/20170513202112 )
gcc: WARN
gcc: WARN The current situation usually arises when a Plan has a direct
gcc: WARN dependency on one version of a package (`acme/A/7.0/20160101200001`)
gcc: WARN and has a direct dependency on another package which itself depends
gcc: WARN on another version of the same package (`acme/A/2.0/20151201060001`).
View gist:94f365a71c4be25f08d732efefc13258
: Loading /src/opam/
opam: Plan loaded
opam: Validating plan metadata
opam: hab-plan-build setup
opam: Using HAB_BIN=/hab/pkgs/core/hab/0.24.1/20170522083228/bin/hab for installs, signing, and hashing
opam: Resolving build dependencies
opam: Resolving run dependencies
» Installing core/aspcud
opam: Resolved dependency 'core/aspcud' to /hab/pkgs/core/aspcud/1.9.1/20170609203426
» Installing core/camlp4
View deps