> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MongoDB-instrumentatie

export const VersionRequirements = ({versions = []}) => {
  if (!Array.isArray(versions) || versions.length === 0) {
    return null;
  }
  const boundaries = {
    upper: " or lower",
    exact: "",
    lower: " or higher"
  };
  const containerStyle = {
    marginTop: "0.5rem",
    marginBottom: "1.5rem"
  };
  const lineStyle = {
    display: "block",
    margin: "0 0 0.35rem 0",
    fontSize: "0.875rem",
    lineHeight: "1.4"
  };
  const pillBaseStyle = {
    display: "inline-block",
    padding: "0.1em 0.4em",
    borderRadius: "0.25rem",
    border: "1px solid",
    fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
    fontSize: "0.85em",
    fontWeight: 500
  };
  const pillColors = {
    "AppSignal for Elixir": {
      background: "#f3e8ff",
      borderColor: "#e9d5ff",
      color: "#9333ea"
    },
    "AppSignal for Front-end": {
      background: "#fef9c3",
      borderColor: "#fde68a",
      color: "#ca8a04"
    },
    "AppSignal for Go": {
      background: "#ccfbf1",
      borderColor: "#99f6e4",
      color: "#0d9488"
    },
    "AppSignal for JavaScript": {
      background: "#fef9c3",
      borderColor: "#fde68a",
      color: "#ca8a04"
    },
    "AppSignal for Node.js": {
      background: "#dcfce7",
      borderColor: "#bbf7d0",
      color: "#16a34a"
    },
    "AppSignal for Python": {
      background: "#dbeafe",
      borderColor: "#bfdbfe",
      color: "#2563eb"
    },
    "AppSignal for Ruby": {
      background: "#fee2e2",
      borderColor: "#fecaca",
      color: "#dc2626"
    },
    "AppSignal for Rust": {
      background: "#ffedd5",
      borderColor: "#fed7aa",
      color: "#ea580c"
    }
  };
  const defaultPillColor = {
    background: "#f4f4f5",
    borderColor: "#e4e4e7",
    color: "#52525b"
  };
  const getPillStyle = name => ({
    ...pillBaseStyle,
    ...pillColors[name] || defaultPillColor
  });
  const getBoundText = bound => {
    return boundaries[bound] || boundaries.lower;
  };
  return <div style={containerStyle}>
      {versions.map((v, i) => <p key={`${v.name}-${v.version}-${v.bound || "lower"}-${i}`} style={lineStyle}>
          This feature requires{" "}
          <code style={getPillStyle(v.name)}>{v.name}</code> version {v.version}
          {getBoundText(v.bound)}.
        </p>)}
    </div>;
};

<VersionRequirements
  versions={[
{ name: "AppSignal for Ruby", version: "1.0" }
]}
/>

De [Mongoid]-gem is afhankelijk van de [Mongo Ruby Driver]. AppSignal activeert de Mongo Ruby Driver-instrumentatie automatisch als deze in het project wordt gedetecteerd.

De MongoDB-instrumentatie van AppSignal ondersteunt de [Mongo Ruby Driver]-gem en de [Mongoid]-gem direct; er is geen handmatige configuratie nodig. Wanneer AppSignal MongoDB-metrieken detecteert, maakt het een [Magic Dashboard](#magic-dashboard) aan, waardoor u kerncijfers visueel kunt monitoren.

## Performance-monitoring

Zodra AppSignal begint met het rapporteren van MongoDB-metrieken, geeft AppSignal u prestatie-inzichten via:

* [Event-tijdlijn](#event-timeline)
* [Sample-overzicht](#sample-breakdown)
* [Slow queries](#slow-queries)

### Event-tijdlijn

De event-tijdlijn biedt u diepgaande inzichten in de prestaties van MongoDB-queries, waardoor u precies kunt zien welke queries worden uitgevoerd, wanneer, en welke impact ze hebben op de responsiviteit van uw applicatie.

<img src="https://mintcdn.com/appsignal-715f5a51/4TRZP0Sq9Zq7PAPW/assets/images/screenshots/ruby/integrations/mongodb/event-timeline.png?fit=max&auto=format&n=4TRZP0Sq9Zq7PAPW&q=85&s=f3f8e02b4125bccc426dc388631ae24a" alt="Example MongoDB event timeline" width="1314" height="680" data-path="assets/images/screenshots/ruby/integrations/mongodb/event-timeline.png" />

### Sample-overzicht

Met sample-overzichten kunt u in één oogopslag MongoDB-prestaties bekijken, waardoor u snel prestatieproblemen kunt opsporen zonder diep in de details te hoeven duiken.

<img src="https://mintcdn.com/appsignal-715f5a51/4TRZP0Sq9Zq7PAPW/assets/images/screenshots/ruby/integrations/mongodb/sample-breakdown.png?fit=max&auto=format&n=4TRZP0Sq9Zq7PAPW&q=85&s=43404cce6c91f5d9162541884e9a1766" alt="Example MongoDB performance sample" width="1310" height="430" data-path="assets/images/screenshots/ruby/integrations/mongodb/sample-breakdown.png" />

### Slow queries

AppSignal heeft een hele suite aan tools om u te helpen de prestaties van uw applicatie te verbeteren. Slow queries is een eenvoudig en informatief overzicht van de trage queries van uw applicatie en de impact die deze hebben op de prestaties van uw applicatie, waardoor u snel en met vertrouwen kunt beslissen welke stappen nodig zijn om ze te optimaliseren.

<img src="https://mintcdn.com/appsignal-715f5a51/4TRZP0Sq9Zq7PAPW/assets/images/screenshots/ruby/integrations/mongodb/slow-queries.png?fit=max&auto=format&n=4TRZP0Sq9Zq7PAPW&q=85&s=b08cf67361773c2cb5b900d8be3e6255" alt="Example of AppSignal slow queries feature" width="2050" height="1030" data-path="assets/images/screenshots/ruby/integrations/mongodb/slow-queries.png" />

## Magic dashboard

Wanneer AppSignal MongoDB-metrieken ontvangt, wordt er een MongoDB magic dashboard aangemaakt, beschikbaar in de dashboardsectie van de AppSignal-app.

Het MongoDB magic dashboard bevat de volgende grafieken:

| Grafiek                                 | Metrieken                | Tags       |
| --------------------------------------- | ------------------------ | ---------- |
| [Throughput](#throughput-graph)         | `mongodb_query_duration` | `database` |
| [Query duration](#query-duration-graph) | `mongodb_query_duration` | `database` |

Tags geven u een contextueel overzicht van de prestatie-informatie van Active job. Momenteel rapporteert AppSignal de volgende tags voor Active Job-jobs:

| Naam       | Beschrijving                                              |
| ---------- | --------------------------------------------------------- |
| `database` | Naam van de database waarvan de metriekdata afkomstig is. |

Elke tag wordt op de grafiek weergegeven met een gekleurde lijn:

<img src="https://mintcdn.com/appsignal-715f5a51/4TRZP0Sq9Zq7PAPW/assets/images/screenshots/ruby/integrations/mongodb/dashboard.png?fit=max&auto=format&n=4TRZP0Sq9Zq7PAPW&q=85&s=c1765eeec6ec674e68749b07af56a796" alt="Example MongoDB dashboard" width="1432" height="672" data-path="assets/images/screenshots/ruby/integrations/mongodb/dashboard.png" />

### Throughput-grafiek

De Throughput-grafiek toont het aantal queries dat op elke MongoDB-database wordt uitgevoerd.

U kunt deze grafiek gebruiken om te begrijpen hoeveel queries de databases van uw app verwerken, om inefficiënte queries op te sporen en potentiële n+1- en schaalproblemen te identificeren.

### Query duration-grafiek

De Query duration-grafiek toont de 95e percentiel en de gemiddelde duur van de queries die op elke MongoDB-database worden uitgevoerd.

U kunt deze grafiek gebruiken om de prestaties van databasequeries te begrijpen, prestatieproblemen op te sporen en trage queries fijn te tunen.

[Mongoid]: https://github.com/mongodb/mongoid

[Mongo Ruby Driver]: https://github.com/mongodb/mongo-ruby-driver
